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

Rotate a Cloned Model?, i need help!

Asked by 5 years ago
Edited 5 years ago

I want to rotate a modul so i can use it for a character creator but i dont have the knowledge to do so.. here is where i clone it and place it but the char is facing in the wrong direction.

 local object = game.Workspace.StarterCharacter

local StartCharacter = object:Clone()
StartCharacter.Parent = game.Workspace
StartCharacter:SetPrimaryPartCFrame(CFrame.new(-204.946, -35.962, -1297.14)

)

0
CFrame.Angles is the property you need. stock458 51 — 5y

1 answer

Log in to vote
0
Answered by
aazkao 787 Moderation Voter
5 years ago

To rotate a CFrame you multiply it like this

 local object = game.Workspace.StarterCharacter

local StartCharacter = object:Clone()
StartCharacter.Parent = game.Workspace
StartCharacter:SetPrimaryPartCFrame(CFrame.new(-204.946, -35.962, -1297.14)*CFrame.Angles(0,90/(180/math.pi),0))

that will rotate it 90 degrees in the Y axis, Cframe.Angles uses radians, and 1 radian is 180/pi, so to get 90 degrees in radians we just take 90 divided by (180/pi)

0
math.rad(degree) is there to use too. xPolarium 1388 — 5y
0
oh didnt realise that, i dont use the math functions alot aazkao 787 — 5y
Ad

Answer this question