I'm trying to make a Cframe smoothly change basically like TweenService. I tried tweening it but it doesn't work, if someone could help me I would be really grateful
Start as CFrame.new(0,-0.2,-0.4) End as CFrame.new(-0.273,-0.052,0.2)
I'm trying to make a Cframe smoothly change basically like TweenService. I tried tweening it but it doesn't work, if someone could help me I would be really grateful
Start as CFrame.new(0,-0.2,-0.4) End as CFrame.new(-0.273,-0.052,0.2)
You can lerp through it
local RunService = game:GetService("RunService")
local StartCF, EndCF = CFrame.new(2,5,1), CFrame.new(8,12,9)
local CFHolder = StartCF
for i = 0,1,0.01 do
CFHolder = StartCF:Lerp(EndCF, i)
RunService.Heartbeat:Wait()
end
You can use TweenService https://developer.roblox.com/en-us/api-reference/class/TweenService
Example:
local NewTween = game:GetService("TweenService"):Create(instancepartwithvaluebeingchanged,TweenInfo.new(timethetweentakes,Enum.EasingStyle,Enum.EasingDirection){CFrame = CFrame.new(x,y,z)}
NewTween:Play()
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Thanks!