Hello, My script is simple, to serve as a alteritive to rotation scripts, however, it doesn't work. My script: part = script.Parent
while true do wait(0.1) part.Orientation.X = Vector3.new(part.Orientation.X + 0.1) end
I don't understand why my script is not working properly and intended.
Help is appriciated.
Thanks,
Your script isn't working since it has these fundamental flaws:
- Setting BasePart.Orientation.X
does not change the orientation of the part itself. BasePart.Orientation.X
is just the X property of the Vector3 returned.
- Since BasePart.Orientation
is a Vector3, you must provide all three arguments in it's constructor as such: Vector3.new(x, y, z)
To fix this, you can add a Vector3 to the orientation !Adding Vector3s and use the X property of the same !X property of Vector3s
Finally to write the script, this should do whatever you're trying to achieve:
Script using orientation:
lua
while true do
wait(0.1)
part.Orientation = part.Orientation + Vector3.new(0.1, 0, 0)
end
<br> Also, as commented on your post and mentioned by the wiki,
For better control over the rotation of a part, it is recommended that BasePart.CFrame is set instead
Script using CFrames:
lua
while true do
wait(0.1)
part.CFrame = part.CFrame * CFrame.Angles(math.rad(0.1), 0, 0)
end
Please comment if you have questions or I have made a mistake