Visual Scripting / Bolt: Performance ? problem with incredibly slow movement

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.

You are correct. The reason the gravity stops working is because you overwrite the velocity with the movement vector you create and that has no gravity applied to it.

I don’t have this problem in my project because I froze the y-position and my character is just slightly above the ground, but we should be able to figure something out. I have unfrozen my Y position and moved the player up to y = 10 and the falling works fine as well as movement. I don’t have any jerky movement. How is your Rigidbody set up?

Hi bixarrio,

Thanks for your answer. I am just at the beginning of the “Arrows Away” tutorial.

Yes, y-position frozen and positioning the player slightly above the ground makes sense. I only checked the rotational constrains as suggested in the video " Rigidbody Movement" at the end (11:40) and left the translational constrains unchecked.

The Rigidbody has default values:
rigidbody

use gravity checked, gravity at the default y value -9.81 in project settings, is kinematic unchecked.

I can’t see anything wrong here. Usually jerky movement is caused be the collider hitting the terrain when the player moves. This is why my own character is just slightly off the ground. Then the collider won’t hit the terrain. But even if it does, I don’t get any jerky movement. It’s difficult for me to determine what you are experiencing. Could you possibly upload your project somewhere so I can take a look?

The movement in x-direction is ok, but not smooth. But as in the following lectures the camera is connected to the player and follows the player, this is not so bad.

But if you would like to have a look, I have uploaded the zipped folder 121 mbyte, available for 30 days

in the script graph “PlayerController” you can find four groups for onFixedUpade code.

Only use one of these by connecting “onFixedUpade event” with “setVelocity” and disconnect in the other groups. With the course graph the player slowly hovers to the ground.

Sorry, didn’t get to this sooner 'cos I’ve been a little busy. I had a look and the jerkiness is very subtle. It is the same in my project, I just hadn’t noticed because, as you said, the camera is later attached to the player and we have a first-person view. I have been struggling to fix it, though. Changing the movement to transform instead of rigidbody seems to work, but then we lose the collisions with the walls. I will look at it some more a little later and see if I can come up with a solution

Hi bixarrio,

This is my first course here on gamedev.tv.
And i like this visual script course.

Are you part of the gamedev team or does “Master Problem Solver” mean, you are very active in this forum ?

Do you know, if this course is still under development as said in the last lecture “More to come” ?

I am just a lowly community member with no life. “Master Problem Solver” is just a badge you get after providing solutions to 10 posts.

I do not, but I certainly hope so. I would like to see some stuff with the state machines, etc. After I finished the course, I went ahead and did some extra-curricular learning and implemented a state machine graph in my own Arrows Away, but I would really like to see it in the course.

Ha ha, ok. So i am going to be a “master questioner” in future :slight_smile:

“I would like to see some stuff with the state machines…”, we will see.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms