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

How do u do an if then based on orientation?

Asked by 5 years ago
Edited 5 years ago

I have tried the following and none of them work.

if script.Parent.Part.Orientation == script.Parent.Part.Orientation(0,-180,0) then
else if script.Parent.Part.Orientation == Vector3(0,-90,0) then
else if script.Parent.Part.Orientation == Vector3.new(0,-90,0) then

Any ideas?

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Actually they'd work if you wrote them correctly, here, I'll show you what you did wrong.

if script.Parent.Part.Orientation == script.Parent.Part.Orientation(0,-180,0) then

Should Be:

if script.Parent.Part.Orientation == Vector3.new(0,-180,0) then

AND

else if script.Parent.Part.Orientation == Vector3(0,-90,0) then

Should Be:

else if script.Parent.Part.Orientation == Vector3.new(0,-90,0) then

And the last one is perfectly fine.

0
My bad, thanks. xD captain_bboy 22 — 5y
0
No problemo Cvieyra2test 176 — 5y
Ad

Answer this question