Making a BasePart follow you without loops

I was told that loops should overall be avoided when events such as .Changed and :GetPropertyChangedSignal exist. So my question is how would I make a part follow a character (or a Vector/CFrame) avoiding the usage of loops?

So far, I’ve came across RocketPropulsion which seems to be the only body mover that may be capable of doing this.

EDIT: After a while, I discovered instances such as BodyPosition and AlignPosition which both can accomplish this with the downside of less control.

1 Like

You can connect to the heartbeat event.

1 Like

Sadly, .Changed doesn’t fire if its a position or CFrame update. Using Heartbeat and RocketPropulsion are probably the best choice.

1 Like

Use heartbeat if serverside and renderstepped if on the client. Keep in mind that this can be up to >30 iterations a second. If you don’t need that level of precision, a standard loop would work just fine.

1 Like

Use Heartbeat for both environments. Use RenderStepped only if you reasonably need something to run before the execution of a render tick, such as camera updates or something that needs to update in the same relative frame as the camera.

Use attachments along with AlignPosition / AlignOrientation.

RenderStepped ould be synced with the client it is fired every render frame

https://developer.roblox.com/en-us/api-reference/class/RunService

RenderStepped should be used only for updating the camera because it blocks certain threads
@richard702 for the image,