How does this work in a different way? The only difference is you don’t have to parent your LocalScripts inside of StarterCharacterScripts or some other place that LocalScripts have been programmed to work inside. (I think.) Before this was implemented, there were pretty strict restrictions when it came to LocalScripts being parented to certain things. Other than that, I see no difference. The RunContext is not meant for moving parts by itself. RunService is an automated function that can move parts by frames. RunContext on the other hand, is used for changing how scripts function. Changing it to Client will only make the code inside it run for the Client. Changing it to Server… well I have no idea what that does actually. I assume it’s just the somewhat outdated version of Legacy or whatever purpose it serves. Regardless, the RunContext will not change crap when it comes to part CFrame, Positions, etc. You cannot compare RunService with RunContext. They are totally different things with different purposes.
Ah, guys. Finally updated this post! Sorry, I’ve been incredibly busy and admittedly lazy . It’s okay though, cause now I have updated this one.
Is there a reason why you’re using task.wait() in a Heartbeat connection? Also you can get deltatime in a while loop by doing local delta = task.wait() or local deltatime = game:GetService(“RunService”).Heartbeat:Wait()
What about the prismatic constraint? Also for good enough FPS you should turn the collisions off on the part that will be moved.
tweening works as well btw
The PrismaticConstraint is located underneath the “Constraints” section! You can find it under “Methods with collisions on and welds.” on line 43 and 44.
There’s many ways to move parts around.
Note that these are just some basic examples of moving parts.
-
PrismaticConstraints; this method of movement involves two attachments. One on the part that will be moved. And one on another part which cannot move. (Such as a solid wall)
-
CFrame; Using CFrame is a little more complicated than other methods. This involves Vector3 (You can also use CFrame for rotation)
-
TweenService; you can use this to make different kinds of movements. You just have to set the EasingStyle and EasingDirection, and seconds which the Tween will run for.
-
LinearVelocity; this one is rather simple, you just have to change the XYZ values on the properties and it moves.
I hope this helps.