hey guys , im noob at Unity development and i have a silly question. Im trying to rotate a GameObject smoothly at x axis 90 degrees and then stop like a parking lot traffic barrier. Im using this code:
but this rotate de GameObject forever and dont stop when the x axis exceeds 90, why is that ? Whats the best ad the simpliest methods to do what I want ?
Another option is to use a Tweening Engine like DOTween for simple animations like this. It will make things easier to code and test, especially if you’re just starting.
This is what I’m doing in one of my games to drop a white flag when a villain surrenders. 20 degrees on Y, 40 degrees on Z - 0.2 seconds for the move. Simple.