Best way for Helicopter Rotation?
forklift
Member Posts: 386
If anyone's made a helicopter in their game before, I'd like to hear your input on the ways you made it rotate realistically in a side view. Note: the actual vehicle, not the blades - that's in an animation.
I have the helicopter's (not controlled by player) animation facing the direction of travel based on X velocity.
This works:
When self.movement.X is (equal to or greater than) 1, use right-facing animation
When self.movement.X is (equal to or greater than) -1, use left-facing animation
When self.movement.X = 0, use the last-facing animation (so it's still facing last direction of travel)
But when I add in rotate logic, it doesn't reset to the original (non-rotated) position.
When self.movement.X is (equal to or greater than) 1, use right-facing animation, and rotate to 335 degrees
When self.movement.X is (equal to or greater than) -1, use left-facing animation, and rotate to 25 degrees
When self.movement.X = 0, use the last-facing animation (so it's still facing last direction of travel), rotate to 0 degrees.
For some reason it keeps adding the rotation value, even when i have the Otherwise statement using a 0 degree rotation. so after a few passes of left and right, it's basically upside down or straight up and down.
Any pointers?
I have the helicopter's (not controlled by player) animation facing the direction of travel based on X velocity.
This works:
When self.movement.X is (equal to or greater than) 1, use right-facing animation
When self.movement.X is (equal to or greater than) -1, use left-facing animation
When self.movement.X = 0, use the last-facing animation (so it's still facing last direction of travel)
But when I add in rotate logic, it doesn't reset to the original (non-rotated) position.
When self.movement.X is (equal to or greater than) 1, use right-facing animation, and rotate to 335 degrees
When self.movement.X is (equal to or greater than) -1, use left-facing animation, and rotate to 25 degrees
When self.movement.X = 0, use the last-facing animation (so it's still facing last direction of travel), rotate to 0 degrees.
For some reason it keeps adding the rotation value, even when i have the Otherwise statement using a 0 degree rotation. so after a few passes of left and right, it's basically upside down or straight up and down.
Any pointers?
Comments
Maybe I need a long set of rules so that the actor has time to rotate to angle and back to zero properly. Such as:
When self.linearvelocityX >= -11 <= -15 & rotate to 15
When self.linearvelocityX >= -6 <= -10 & rotate to 10
When self.linearvelocityX >= -1 <= -5 & rotate to 5
When self.linearvelocityX = 0, rotate to 0
When self.linearvelocityX >= 1 <= 5 & rotate to 355
When self.linearvelocityX >= 6 <= 10 & rotate to 350
When self.linearvelocityX >= 11 <= 15 & rotate to 345
you get the idea... i'll try this later and report back.