My Character Moving Upward

When I press key down, the chracter moves but even it moves upward which means y-axis.

Even no keys are down, it moves to upward after any key was pressed down once.

The attached test project made with Unity 2.5 for Windows.

The script file which is used for Player game object, ‘ThirdPersonController’ is from 3DPlatformer tutorial.

Any ideas?

Thank you.

196048–7027–$testproject_189.zip (187 KB)

hey,

i found your problem… it has something to do with your jump function.
and because your character has no gravity applied it floats upwards.

put this code in your update and it will fall on the ground.

moveDirection.y -= gravity * Time.deltaTime;

the only problem you now get is that your character gets slammed everytime.
(this is what i found out… i can be wrong… i’m not the best in scripting)
i hope it got you further in your struggle :stuck_out_tongue:

The attached file was from 3D Platformer Tutorial, so it should be worked fine but not.

When I was checked “Can WallJump” variable to be true, all things work fine.

The scirpt has no problme with the option “can walljump” has true for its value.

Thank you.