Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

Jittery Movement using SetLinearVelocity

Here you can find answered ScriptAPI topics.
Forum rules
By using the forum you agree to the following rules.
Post Reply
ClockworkDice
Fighter
Fighter
Posts: 27
Joined: Wed Nov 02, 2016 12:59 am
Started SFD: Sometime in Pre-Alpha
Gender:

Jittery Movement using SetLinearVelocity

Post by ClockworkDice » Mon Jul 24, 2017 1:11 am

Hi, so I've spent a while creating a hoverboard script today, and it works fine in the map editor. The problem is that when I host an actual game, even if I'm the only person in the server, the movement of the hoverboards is super jittery. I can only expect this effect to become worse if other people join my game. Is this just a problem with SetLinearVelocity that I'll have to live with? Is there a different way to manipulate velocity that doesn't have this problem? Any help would be greatly appreciated.
1 x

User avatar
JakSparro98
Superfighter
Superfighter
Posts: 387
Joined: Fri Jul 15, 2016 7:56 pm
Started SFD: PreAlpha 1.0.5
Location: Rome, Italy
Gender:
Age: 20

Post by JakSparro98 » Mon Jul 24, 2017 9:31 pm

ClockworkDice wrote:
Mon Jul 24, 2017 1:11 am
Hi, so I've spent a while creating a hoverboard script today, and it works fine in the map editor. The problem is that when I host an actual game, even if I'm the only person in the server, the movement of the hoverboards is super jittery. I can only expect this effect to become worse if other people join my game. Is this just a problem with SetLinearVelocity that I'll have to live with? Is there a different way to manipulate velocity that doesn't have this problem? Any help would be greatly appreciated.
One year ago I had the same problem, I cannot find where the topic was posted though.
Try to set the player position on himself before applying SetLinearVelocity.
0 x

ClockworkDice
Fighter
Fighter
Posts: 27
Joined: Wed Nov 02, 2016 12:59 am
Started SFD: Sometime in Pre-Alpha
Gender:

Post by ClockworkDice » Tue Jul 25, 2017 6:39 pm

So you're saying that I should set the hoverboard's position to itself before changing velocity?
Like this: hoverboard.SetWorldPosition(hoverboard.GetWorldPosition());

I'll try it, but I'm not sure why that would have any effect.

EDIT: I tried it, and it actually made the problem worse. The problem is almost entirely on the Y-axis while moving upwards, if that helps.
0 x

User avatar
JakSparro98
Superfighter
Superfighter
Posts: 387
Joined: Fri Jul 15, 2016 7:56 pm
Started SFD: PreAlpha 1.0.5
Location: Rome, Italy
Gender:
Age: 20

Post by JakSparro98 » Tue Jul 25, 2017 10:13 pm

Can you please post your code so I can investigate the issue?
0 x

User avatar
Motto73
Superfighter
Superfighter
Posts: 287
Joined: Mon May 09, 2016 7:35 am
Title: Superfighter Royale
SFD Account: Motto73
SFD Alias: Motto73, Pack-Man!
Started SFD: Multiplayer Test Demo
Location: Sunny City
Gender:
Age: 19

Post by Motto73 » Wed Aug 16, 2017 12:59 pm

Yea, having the same problem with many scripts with calling some method very much on shprt time. OnUpdate things update faster in the map editor, even if there's as many frames when hosting.
0 x
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest