Following the example in “Rigidbody Movement” and “Finishing Player Movement” i have a problem with a jerky and slow movement:
The graph variable “movementSpeed” of type float is set to 5 and the players movement in x-direction is ok, but stuttering. When the variable ist set to a higher value, the jerking increases.
The problem becomes even more visible, if the player capsule is moved up before starting the game. Then the players capsule needs 45 ! seconds for 10 units (meters) to sink to the floor instead of 1 second.
The graph as used in “Finishing Player Movement” is:
When i use the following graph instead this 10 m fall to the ground lasts only one second (as intended:
Can anybody help and explain why the physics is slowed down with the first graph ?
I partially found the reason and a solution:
In every frame the body is accelerated by gravity and slowed down by the setVelocity-command, which only sets the velocity in x-direction. This is not a problem, if the player is positioned on the ground on start. But it is visible, if it is positioned with an offset above the floor.
Adding the y-value to the vector solves this.
The jerky movement in x-direction still occurs. May be my laptop is too slow or a c# script instead of a visual skript helps.