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

How can i fix this Orientation rotate script?

Asked by 7 years ago
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

Log in to vote
1
Answered by 7 years ago

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...

0
Do your research before you say "something does not exist". hiimgoodpack 2009 — 7y
0
Also, Orientation needs a Vector3 value, not a CFrame value. http://wiki.roblox.com/index.php?title=API:Class/BasePart/Orientation hiimgoodpack 2009 — 7y
Ad
Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

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!

Answer this question