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

So I cant find out how to move the cframe of this object using tweening?

Asked by 4 years ago

So I wrote this code to tween a certain object to a certain position

01local Part = script.Parent
02    local Length = 3.5
03 
04    local TweenService = game:GetService("TweenService")
05    local tweenInfo = TweenInfo.new(
06 
07    Length,
08    Enum.EasingStyle.Linear,
09    Enum.EasingDirection.In,
10    0,
11    false,
12    0
13)
14 
15 
View all 24 lines...

so the "MoveHere2" Part is a part I made so I didn't have to specify a CFrame but it glitches out the original part when I make it move here, the reason why, I think, is that it's trying to move up and sideways at the same time, so it does not smooth and it just jumps around over the place.

For example: If I was trying to make a vent door fall open i'd need to change the orientation + the height and the z-axis position, but then when it runs the code it flops around everywhere until it gets to the position but thats not the goal, the goal is to make it smooth while going to that position

1 answer

Log in to vote
2
Answered by 4 years ago

Hello! You have to use put the goals in a table. I saw that you did not add the goals to the table properly. Instead, try this:

01local Part = script.Parent
02    local Length = 3.5
03 
04    local TweenService = game:GetService("TweenService")
05    local tweenInfo = TweenInfo.new(
06 
07    Length,
08    Enum.EasingStyle.Linear,
09    Enum.EasingDirection.In,
10    0,
11    false,
12    0
13)
14 
15 
View all 25 lines...

This will make all of the goals go in a table.

0
oh wow lol that sure did fix it didnt know it would be that simple of a fix, anyways thanks! NvidiaGeForce2080Ti -5 — 4y
Ad

Answer this question