What do you want to achieve? Keep it simple and clear!
Stop the tween thing rotating
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
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)
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.