Rigidbody player

Hey everyone,

I was trying to make a player out of a rigidbody just to test my scripting skills :P. Alomst everything
is working fine now. I’m using a forcemode.impulse for the jump and a tranform.Translate for the movement
of my character. What I noticed is that when I jump or run into a wall, my character is vibrating against it.

So I tried it differen for the movement with a rigidbody.velocity, but now I can’t
move my character and jump at the same time. plus my character won’t vibrate but freeze when i jump into a will, thats ok for when i run into it, but freezing in mid air looks a bit strange :slight_smile:

Is there any way to script so the player will just fall down when I jump into a wall?

addforce seamed to work for the wall problem, but I don’t want an accelerating player, which always happens for me, even when I use ForceMode.Force…

thanks in advance!

Use ForceMode.Force in order to accelerate to (desiredVelocity.normalized * (desiredVelocity.magnitude - velocity.magnitude))
desiredVelocity should be your desired direction * top speed.

This way, your character will accelerate in attempt to reach top speed. Once it reaches top speed, it won’t get any faster.

and is there anyway to let the player not get stuck in any wall when I jump into it? The player foes fall down when I release the movement button, but when I keep pressing it, it will stay on the same height…

any solutions?

Its because you’re pushing the player into the wall I think. You might want to try adding bounce to the wall. Maybe change the physics material.

If that still doesn’t work, you could use a script that pushes the player away if he touches it. Also, try messing around with the gravity. Good Luck!

Set the character’s physic material’s friction to 0 with minimum combine. Might want to do that with bounce too.

Thanks everyone for the help :slight_smile: