Player wont jump..

Hey,

I tried to find a complete jumping script for my game (It’s just cube jumping on levels). But I don’t know c# very well… I’m more familiar with c++, and I haven’t gotten any of those jump scripts to work. I don’t know what’s wrong…

I got the cube to move upwards but that’s not the way I want it. I want the “normal” jump… like when I press space it goes up with decreasing power (because of gravity) and then it lands and I want to be able to set the height of the jump.

So please find the script attached. I made it and thought it would work but it actually the cube wont even move upwards atm.

Also… what do u think is the best way to learn c# for unity? should I start learning first c# and after I know it better start unity scripting or is there some source where I can study like “unity c#” :smile: I hope you know what I’m talking about.

thanks in advance

1971945–127804–PlayerJump.cs (602 Bytes)

Just use the generic fps controller script in standard assets.

Thanks!
You the man, Vintar!

Now I start studying how to use it :smile:

There is a prefab in the Character controller folder, just drag it onto the screen and voila, done :wink:
You can even change it to a square if you want.

http://docs.unity3d.com/ScriptReference/
Has all unity specific C# information with examples… It’s a good place to start with the simple stuff.

well… :smile: it’s not working as I expected…

If I add that fps controller, it will mess my camera up… and I want this to be like third person.
So when I try third person controller it just adds some crazy construction worker with my cubes :smile: and I have no clue how to link those movements to my Playercube :smile:

I’m currently practicing with this tutorial serie, but I want to add the jump so player can do more in the game.

Thanks image28 for good advice! :slight_smile: