Hi,
I’ve got my character moving and looking around in unity just the way I like it. What I can’t do is make the character jump. The character has a rigidbody and a character controller attached. I’m using my own script to make him move, but I’m using the character controller to do it. What do I do?
Thanks
Err, add some upwards momentum to the move command when the jump key is pressed???
Important: You should share your piece of code too, when asking a question.
You have added Rigidbody, so turn off its Gravitycheckbox. Then Use CharacterController 's Move function to achieve this.
Should you even have a rigid body on a character controller?
I’m pretty certain there are a hundred tutorials out there, both in web page and YouTube form, that cover this basic level of making games in Unity. Pretty sure the Unity website has a couple too. View the 3D platformer tutorial here
http://unity3d.com/gallery/demos/demo-projects
You could have googled this stuff pretty easily.
Google rigidbody and character controller. You only want one not both. Rigidbodies are mainly for objects that have applied forces like cars, airplanes etc.
Just google and you’ll get more then enough info on which one to use. Plus there are so many basic tutorials on basic movement.
First of all, I should clarify that I’m a little green when it comes to scripting in unity, and this is also my first project where I’m coding. Here’s my code for jumping:
if(Input.GetAxis(“Jump”) > 0)
{
characterController.Move(transform.up * playerJumpSpeed * Time.deltaTime);
}
Right now when I press space I just move upward indefinantly, and when I let go of the space bar, I don’t fall down. What exactly do I do.
Thanks