- Home /
handling player impact in a proper way
hi i have a quite a complicated question for me at least . in my player controller class i use unity's characterController component to move the player based of the input i give it to it and multiply it with speed and add the gravity like this
CurrentImpact = vector3.lerp(CurrentImpact,vector3.zero, damping * Time.DeltaTime)
velocity = InputDirection();
velocity *= Speed();
velocity += Gravity;
velocity += CurrentImpact;
CharcerController.move(velocity * Time.deltatime)
my problem is with CurrentImpact. CurrentImpact is a vector3 that i use to add force to the player like jumping and pushing the player around put if i do like adding a force facing left maybe and the player is trying to move right, the player will go right then will start drifting a little bit on the left again so what i think i want is a way to make the CurrentImpact Face the direction of the input movement if its weaker than it without changing its magnitude.
i hope you understand me and thanks
Your answer
Follow this Question
Related Questions
RigidBody Character Controller Bug 0 Answers
CharacterController.Move becomes really slow after I move seperate colliders 1 Answer
Player Control. Roller Ball with Cube Acceleration. 1 Answer
Voxel engine physics 3rd person character controller 1 Answer
Character Controller + Animation Not Working As It Should 0 Answers