I was creating a golf game some time ago but I stopped working on it because I couldn't create a wind factor that is precise. I would like to know if there is an event that fires along with every physics update so I can maybe add it.
✓ ANSWER ACCEPTED
Does a PhysicsStepped event exist?
2 answers
✓ Accepted answer
Fifkee is wrong, you never want to do any physics related updates with RenderStepped, that should be reserved for camera manipulation only! Even in the link he provided, it shows that the physics simulations happen after the render occurs. If you do decide to use RenderStepped for everything, your game will have low fps even on high end computers. So what you should do instead is use the Heartbeat:
game:GetService("RunService").Heartbeat:Connect(function()
end)
Physics updates occur every frame. Knowing this, you can utilize the RenderStepped signal like so:
game:GetService("RunService").RenderStepped:Connect(function()
end);
You can see what happens in a frame in this image provided by the Roblox Developer Forum: https://devforum.roblox.com/t/how-does-runservice-work/619565/2
This discussion is preserved as it was. New answers, comments, and votes are closed.
