Tweening the C1 Position property

I would like to tween the C1 Position property, or have an efficient+smooth way to move it from one value to another.

I have done my research and have found how to tween the C1 cframe value, which changes both the rotation and position of the part. However I would like the rotation to stay the same and im really struggling to find a workaround.

This is the closest ive got, however I have small knowledge of how cframes work generally. It would be easier for me to have a way to alter just the position.

ts:Create(crane.Motors.ARM1EXT,TweenInfo.new(3,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,false,0),{C1 = CFrame.new(-0, -0, -1.85)}):Play()  

If anyone knows an answer or can help I would greatly appreciate it!

local goal = crane.Motors.ARM1EXT.C1 - crane.Motors.ARM1EXT.C1.Position + Vector3.new(-0, -0, -1.85) -- change the vector to what you want
ts:Create(crane.Motors.ARM1EXT,TweenInfo.new(3,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,false,0),{C1 = goal}):Play()  

this should work. you use the original C1 but subtract its own position so its only the rotation left. then add your own position!

Thank you so much, life saver.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.