Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Stepped event doubt/How to make some loop run precisely with physics?

Asked by
Dfzoz 489 Moderation Voter
4 years ago
Edited 4 years ago

I am creating a golf game that has a wind factor using BodyForce. The game checks every .2 seconds or when a touched or touchended happens on the golf ball, as to apply the force only when it is midair. No other code mess with ball physics, just a gyro and customproperties of ball and ground parts.

The problem I saw is that, when I tried to recreate a server strike with same angle and velocity, the balls end up in slightly different places. I think it might be because of that .2 loop, so I would like to know if stepped would give more precise results or if there is any other method that would do it.

Notice touched and touchended werent enough to check if ball is touching ground or not, as sometimes it fails and wind still applies on ground.

0
RunService.RenderStepped ?? Mr_m12Ck53 105 — 4y
0
This one applies according to player fps, so its not constant Dfzoz 489 — 4y

Answer this question