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

How can i fix this Orientation rotate script?

game.Workspace.Part.Orientation = CFrame.fromOrientation(5,5,5)

In the output it says this : bad argument #3 to 'fromOrientation' (number expected, got no value)

Help?

2 answers

First of all their is no such thing as from orientation.. use CFrame.new or Vector3.new

example:

workspace.Part.Orientation = Vector3.new(5,5,5)

-- or....
workspace.Part.Orientation = CFrame.new(5,5,5)

Either one will work...

3 comments

0

Do your research before you say "something does not exist".

0

Also, Orientation needs a Vector3 value, not a CFrame value. http://wiki.roblox.com/index.php?title=API:Class/BasePart/Orientation

CFrame.fromOrientation does not return anything. It is like how this prints nil.

local p = print('Hello world!')
print(p)

Also, Orientation needs a Vector3 value, so you would do

workspace.Part.Orientation = Vector3.new(5, 5, 5)

If you wanted to CFrame it, you would do

workspace.Part.CFrame = CFrame.Angles(math.rad(5), math.rad(5), math.rad(5))

Just a reminder, CFrame.Angles needs radians. So, you technically could do this

workspace.Part.CFrame = CFrame.Angles(0, 90, 0)

but it probably would not be what you want. You should do

workspace.Part.CFrame = CFrame.Angles(0, math.rad(90), 0)

to get radians. Hope this helps!

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