- Home /
Question by
Jtown_ · Apr 30, 2018 at 05:50 AM ·
rigidbodycharactercontrollerjumping
Why isn't my character jumping??
Hi Guys, I am relatively new to Unity and am wondering why I cannot get my player to jump. This is the code I have so far, any suggestions help :)
CharacterController characterController;
Rigidbody rb;
public float jumpVelocity;
private void Awake()
{
characterController = GetComponent<CharacterController>();
rb = GetComponent<Rigidbody>();
}
private void Update()
{
if (characterController.isGrounded && Input.GetButtonDown("Jump"))
{
Debug.Log("Jump");
rb.velocity = Vector3.up * jumpVelocity;
}
}
Comment
Can you provide us also with the characterController class? Do you get the "Jump" message in the console?
Yes, I get the jumping message in the console. I was able to get it working. Thank you!
Best Answer
Answer by bolkay · Apr 30, 2018 at 06:10 AM
I think this should help you. https://docs.unity3d.com/ScriptReference/CharacterController.Move.html
Your answer
Follow this Question
Related Questions
attached.Rigidbody isn't working with a ChactacterController? -1 Answers
Using isGrounded with a RigidBody 2 Answers
How to add explosion force to player? 1 Answer
Can't use Rigidbody or Character Controller 0 Answers
Jumping with rigid body3d 1 Answer