In my 3d game my character doesnt jump even though using a working script. Does anybody know why this is, is it to do with anything in this screenshot. I have made sure all settings are shown in inspector.
![alt text][1]
[1]: /storage/temp/151835-capsule.png
And heres the code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Jump : MonoBehaviour
{
public Rigidbody rb;
public float jumpForce = 100f;
public void jump()
{
if (Input.GetKey("space"))
{
rb.AddForce(0, jumpForce, 0, ForceMode.VelocityChange);
}
}
}
↧