Local StarterCharacterScript causes intense lag, on all devices

Really, you don’t need to do this. Removing that section of code works just as fine.

It also cleans it from memory so it doesn’t sit there and take up memory that could otherwise be used.

So should I disconnect() it so I prevent memory leaks, or do I remove the section of the code?

Both work. The event will get disconnected when the script gets deleted on character respawn. I’d keep it simple and remove the code.

1 Like

Either probably but heartbeat is more conventional, it runs at the same rate as stepped so either one will probably lead to very similar results. Stepped runs before the physics simulation

Heartbeat running 240 times a second is just false (unless you unlock your fps but then stepped would also run 240 times a second). Both of them run once per frame

1 Like

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