At element 3, the object also has to rotate -90 so it’s is vertical.
I tries a lot of things with eulerangles quaternion (or something like that xD) and what you see in this script (from ‘‘if’’)
(I did x > 2 because element 3 was the only one with x > 2)
I don’t know if you meant to be placed there (I am really new with scripts), but it didn’t work like that. The object doesn’t disappear this time, but it also didn’t rotate
If you were not seeing the compiler error I pointed out, then you may still have other compiler errors you are not seeing. Type some garbage text into your script and make sure it gives you a compiler error, so you can be confident you are actually running the code you typed in.
Now additionally, setting the rotation to Quaternion.identity will take out all rotation and make it “normal” again, so yes, in the code example above, you won’t see any rotation. Take out the setting to identity.
Review the docs pages on transforms; they are pretty key to understanding how Unity arranges its scenes internally.
thnx for the reply.
I already looked at the transform pages, but i couldnt manage to put it in my script. But, what did you meant with ‘Take out the setting to identity’? I dont alwaar understand some english phrases. I think you are dutch? Dan kan je misschien nederlands praten
In the code above you are setting the rotation to (0,-90,0), then immediately “setting it to identity,” which is Quaternion.identity, i.e., no rotation at all (0,0,0).
That does not make sense because the previous line’s operation is completely overwritten and you will see the object is not rotated.
That is what I meant by ‘Take out the setting to identity’. Sorry for my slang! I hope that makes sense.
Remove the Quaternion.Euler line and see where that takes you. Also, set the desired rotation you want your enemies to spawn, which appears to be -90 in the Y plane, in the Project tab. Just click on your enemy prefab, and set the rotation in there. Unity will read the rotation in the prefab and apply it to the enemy when he spawns or at least that’s what it SHOULD do