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

What's the Easiest Way to Change a Model's Orientation?

I know you would have to use some functions on the model's primary part, but what is the most efficient way to do this?

1 answer

✓ Accepted answer

Lets use the :SetPrimaryPartCFrame() function to move/orientate the models

First make sure your model has a PrimaryPart set

Before you set the model's parent, use the function to set its position

We will change its orientation using CFrame.Angles() CFrame.Angles uses something called radians which you will learn in trigonometry. You may be more known with the term degrees instead, roblox gives us a way to easily change degrees to radians without us having to math using math.rad(degrees)

local model=model
--position and orientation
local cf=CFrame.new(0,0,0)*CFrame.Angles(0,math.rad(90),0)

--setprimarypartcframe take a cframe value which is applied to the model's primarypart
--the other parts are moved along with the primarypart
model:SetPrimaryPartCFrame(cf)

2 comments

0

I appreciate the support, but I'm a CS student in college. I have taken Trig and Calculus 2 already. I've known what radians are since eighth grade...

0

@corncob567 Sorry for assuming, most my answers are written for more beginner typed people. That paragraph was pulled from a early post from today that I wrote for someone knowing nothing.

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