Stop pawn Character Movement (Blueprints)
Hi there everyone.
I'm making my first simple game in UE4 and I'm making a Ball roller. The game works with moment along the camera angle using the Forward and Right Vectors, example below.
Now i want to create a stop function when the control button is pressed so i can jump from Platform to Platform and not roll off the end.
I came up with the Idea to get the current Forward Vector and - it from its self * 2 so I would get the negative value. This would then be multiplied by the moment speed and plugged into the Impulse vector input.
This is what I have so far.
Any ideas on how I could accomplish this ?
As I know, rolling template project uses AddTorque to control forward/backward movement.
Maybe it is better to start from there?
It is also possible to use rotating movement component to create rolling behavior. Did you tried it?
I'm really not sure it is a good idea to use physics forces for that. It may produce unexpected behavior.
I tried to play with physics actors and change their velocity on fly, and everything I can to advice is to use SetPhysicsLinearVelocity and SetPhysicsAngularVelocity.
Hope it helps.
answered May 11 '17 at 08:07 AM
You could also try getting the linear velocity of the ball via the "Get Physics Linear Velocity" node and then adding a force opposite that every tick until the ball stops moving.
answered May 11 '17 at 08:18 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here