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

Creating CFrame using Position and orientation?

Asked by 6 years ago

I am trying to create a cframe with a position and orientation to set a model.Not sure how to combine them two.

local SideOne = Vector3.new(0,0,0)
        local OldPos = Cube.MainCube.Position
        Cube.MainCube.Orientation = SideOne
        Cube:SetPrimaryPartCFrame(CFrame.new( ))--CFrame would go here
0
you could use an array to store the cframes using cframe:components() and then change and set them with what you need. abnotaddable 920 — 6y

1 answer

Log in to vote
2
Answered by 6 years ago

You can create a CFrame as you are and set the orientation using CFrame.Angles() like so:

CFrame.new(0,0,0) * CFrame.Angles(0,0,0)

When using this however you must bare in mind that CFrame.Angles() works in radians and therefore any degree values you have must be converted using math.rad()

0
Oh so thats why it never works out how i want it. Thanks raspyjessie 117 — 6y
Ad

Answer this question