CFrame * CFrame.Angles doesn't work properly

Hello everyone!
So i’m trying to make clock decoration for my lobby, so it goes backwards with high speed, but when i tried using CFrame * CFrame.Angles method it didn’t rotate clock part as expected

Script:

local tween = ts:Create(secondHand.SecondPart, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, -1, false), {CFrame = secondHand.SecondPart.CFrame * CFrame.Angles(-360, 0, 0)})
tween:Play()

So instead of making a full 360 rotation it rotates like that
image
(at this point tween ends)

How do i fix that? I do not understand… And it’s really annoying, please help!

CFrame.Angles takes in radians not angles. Try this:

local tween = ts:Create(secondHand.SecondPart, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, -1, false), {CFrame = secondHand.SecondPart.CFrame * CFrame.Angles(math.rad(-360), 0, 0)})
tween:Play()
3 Likes

Angles take radiants lol, I make that mistake too

secondHand.SecondPart.CFrame * CFrame.Angles(math.rad(-360), 0, 0)

Thank you so much!!! The only problem is that is there any way to make tween rotating by 360 angles, beacuse roblox finds closest path to the goal and just doesnt rotate clocks at all?

@ParadoxAssets thanks for helping too, but sorry beacuse this guy gave the answer first. I really apologize!

Try making it positive, I’ve made it work before but I don’t remember how

Thanks for suggestion, but it didn’t work, sadly.

If none of these works you could use a Hinge Servo and give it some velocity
ill try figuring out the tween
else use :BindToRenderStep

1 Like

Thanks, but i prefer using tween service. It’s much easier for me, but if none for real helps - i’ll try your method!

What’s your start CFrame for the secondhand?

The orientation is Vector3.new(-5, 0, 0)

I made it work by using Rotation instead of CFrame

local p = workspace:WaitForChild('torotate')

game:GetService('TweenService'):Create(p, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, math.huge, false), {Rotation = Vector3.new(-360,0,0)}):Play()

else I dont think its possible

Well, the problem is that im using cframe on invisible part which i made for right pivot, beacuse i didnt find a way to change part’s orientation on other pivot except for center (and this invisible part brings a hand model with weld)

Kinda late but I read through his code and it should work

Sorry, i didn’t get clearly what do you mean. But if i got it right, i think that rotating orientation by 360 degrees might work, just changing part’s orientation as i remember is not gonna bring attached with weld objects with it.

local p = workspace:WaitForChild('torotate')
local Orientation = Instance.new('IntValue')

Orientation:GetPropertyChangedSignal('Value'):Connect(function()
	p.CFrame = CFrame.new(p.Position) * CFrame.Angles(math.rad(Orientation.Value),0,0)
end)
game:GetService('TweenService'):Create(Orientation, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, math.huge, false), {Value = -360}):Play()
1 Like

Thank you so much, i’m 99% sure this method should work. I’m kinda tired for today, so if it will work when i decide to test it i will tell you worked it or not. Thanks again!

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