3D Workspace
Home
Assets
Affiliate Program
Creator Program
Sign up/Log in
?
Upgrade
DCC Bridge
Anonymous1780415725
06-02 15:56
Model Name
stylized 3d character
Tags
character
game asset
stylized
Prompt
using UnityEngine; public class PlayerController : MonoBehaviour { public float jumpForce = 7f; private Rigidbody rb; private bool isGrounded = true; void Start() { rb = GetComponent<Rigidbody>(); } void Update() { if (Input.GetKeyDown(KeyCode.Space) && isGrounded) { rb.AddForce(Vector3.up * jumpForce, ForceMode.Impulse); isGrounded = false; } } private void OnCollisionEnter(Collision collision) { if (collision.gameObject.CompareTag("Ground")) { isGrounded = true; } } }
Detailed Info
Related Models
Enter invite code
Enter invite code to get credits!