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
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…
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…