UnityScripterAI
Discord ↗
Link Copied to Clipboard
×
"object jump with space key"
public class Jump: MonoBehaviour { public Rigidbody2D rb; public float jumpAmount = 10; void Update() { if (Input.GetKeyDown(KeyCode.Space)) { rb.AddForce(Vector2.up * jumpAmount, ForceMode2D.Impulse); } } }