Help with tweening

  1. What do you want to achieve? Keep it simple and clear!

Stop the tween thing rotating

  1. What is the issue? Include screenshots / videos if possible!

When tweening a model with the root part and welds it rotates it and I want to know how to fix

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I look for solution but find 0

Hello everyone when tweening a model with a rootpart and welds it rotates the model which is wrong please help me fix.

script.Parent.MouseClick:Connect(function(player) -- this is the click detector 
	
	

	wait(0.5)	

	local tweenservice = game:GetService("TweenService")

	local primary = game.Workspace.M.C.MRoot

	while true do
		tweenservice:Create(primary, TweenInfo.new(7,Enum.EasingStyle.Linear,Enum.EasingDirection.In),{CFrame = CFrame.new(game.Workspace.S.o.BP.Position)}):Play()
		wait(1)
		
	end
	
end)
1 Like

I’m sorry. I can’t understand what you mean. Could you be a little more specific?

Ye man so when I tween this thing I want it just to go straight but instead it rotates itself. So before tweening it is facing forward but when tween done it is facing the right instead of forward

Okay. So I see in the tween, you’re setting the part cframe. CFrame defines both position and orientation. If you don’t include orientation, then the part will rotate itself back to 0,0,0 in the tween.

Edit
To add orientation to a CFrame, just do CFrame.new() * CFrame.Angles(0,0,0)

But CFrame.Angles measures angles by radians, not degrees. So you can use math.rad(90) to turn 90 degrees into a radian angle. For example, CFrame.Angles(math.rad(90),0,0)

If you want to put the orientation of the part back into the cframe, do this.

CFrame.new() * part.CFrame-part.CFrame.Rotation

Instead of using CFrame.Angles, I’m just taking the original part cframe and subtracting the position from the data, leaving only the orientation left.

how to exclude orientation from cframe :eye_in_speech_bubble:


You can’t exclude orientation from the cframe. Check my edited message.

thank you bigly family

1 Like

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