Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Rotate a Cloned Model?, i need help!

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)

)

1 comment

0

CFrame.Angles is the property you need.

1 answer

✓ Accepted answer

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)

2 comments

0

math.rad(degree) is there to use too.

0

oh didnt realise that, i dont use the math functions alot

This discussion is preserved as it was. New answers, comments, and votes are closed.