Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I want to make my part slide not teleport?

Hello,

I want to make so my part sliding up and not teleporting up. Can someone help me with that

This is the script i using now;

script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0,10,0)

But the part just teleport to the position, It wont slide

1 comment

0

You could use velocity or BodyGyro or you could make the part move in incriments e.g for i = 10, 1, -1 etc

2 answers

✓ Accepted answer

Hey there! I'm BlackOrange and I will be helping you with your issue!

You see, there is a way to Tween Objects really Smoothly. This requires the TweenService.

More Info: http://wiki.roblox.com/index.php?title=API:Class/TweenService

To start off, let's get the required variables and everything:

local TS = game:GetService('TweenService')
local PartToTween = script.Parent

PartToTween.Anchored = true
PartToTween.CanCollide = true 
-- Above is making sure you can see it actually tween

local goal = {} -- give it a try
goal.Position = PartToTween.CFrame * CFrame.new(0,10,0) -- I just took this right off your code

local TweenTime = TweenInfo.new(5) -- I'm not good with this but I believe this is TweenTime

local tween = TS:Create(PartToTween, TweenTime, goal)

tween:Play()

Now, I came up with this on the spot, should work. If it doesn't change CFrame to Vector3.

If you need better examples, go to the link above and you can take a look!

Hopefully this helped you on Tweening!

Best of luck my friend!

-- BlackOrange3343

I could just send you a full script. But the thing is, you won't learn anything from that. That's why I will send you to the right direction: http://wiki.roblox.com/index.php/Lerp

If you still need help, then you can DM me on Roblox. Good luck.

1 comment

0

Its better to use tween service for this now, using lerp can be difficult to some people, and tween service has much more animation options.

This discussion is preserved as it was. New answers, comments, and votes are closed.