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

How to smoothly move a part?

Asked by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
8 years ago

Hey all. So, I was wondering if there was some sort of Tween() to move a part, like GUIs have. Now, I know your first response would be to use a while loop, and keep updating its position. The issue with that is, if I have just wait(), lag is an issue. If I have wait(0.01), it's a bit jumpy, or a little behind. Any help is appreciated! (By the way, the game is FilteringEnabled)

What I have so far:

v.Position = v.Parent:FindFirstChild('Head').Position + Vector3.new(0, 3, 0)

That's only a portion, obviously. It's a while loop, with wait(). (To be honest, my friend wanted me to ask this, so he won't give the whole script. Copyright purposes.) Thanks!

1 answer

Log in to vote
1
Answered by
unmiss 337 Moderation Voter
8 years ago

Hiya, shawn. There's already been quite a few questions about this-and it mainly involves Linear Interpolation.

A question on Linear Interpolation

I also believe you can do this with BodyPositions/Gyros, I can't remember exactly-but go onto YouTube and the ROBLOX channel has this featured in one of their 'Hour of Code' videos.

Hope I helped!

Note while a for loop could still be used, there's much more efficient methods than the one you used!

Ad

Answer this question