Hi! Basically, I am trying to make a meshpart shaped like a star that spins round and round, with a script inside the meshpart to do it. However, when i run the game it rotates the wrong way, rotating upright rather than on its side and no, this is not a problem with the way I rotate the part in the script as it works perfectly fine with the other part. Here is all the stuff in my workspace, simple two parts (The meshpart with a script inside and a part with the same script to test whether its the script or the meshpart that is wrong):
As you can clearly see in the image, it is just the part (left) and the meshpart (right). And, that they are BOTH flat on the side (horizontal), so as they have the same script and the part on the left spins fine horizontally, they should both spin horizontally.
The script basically makes the parts spin horizontally, but the meshpart weirdly spin vertically with the same script. This is the script (same script in both parts):
Local part = script.Parent
Local a = 0
repeat
part.Rotation = Vector3.new(0, a, 0)
wait(.01)
a = a + 10
until piggs == 1 --IMPORTANT! The piggs variable is undefined by me as I want it to have no value so the part keeps on spinning. Basically to keep it from not meeting the condition that will stop it rotating.
Here is a video of whats going wrong (So sorry about the lag ):
robloxapp-20210128-1416027.wmv (1.0 MB)
As you can see, the part on the left with the same script rotates fine horizontally, but the meshpart rotates vertically instead. Is this an issue with the meshpart being anchored, it being a meshpart or something else, as it works fine on the other part with same script.
Basically, in short is that both parts before I test are both horizontal, flat on their side. However, when I test the game, the meshpart (star) is rotating vertically, even though the script makes it rotate horizontally and that with the same script the other part is rotating fine horizontally.
Any help would be super appreciated!!!
Thanks a lot!