How to rotate actor to directional of movement?
TyDietrich
Member Posts: 45
I'm trying get my actors to rotate up when i move up, down when i move down, etc. I have been able to get the actors to rotate in a direction, but after they rotate the controls change and up is no longer up and down is no longer down. So how do i get my actors to rotate up when i have them moving, rotate right when they are moving right, etc. I just want the actors to rotate in increments of 90 degrees an not stop at degrees not divisible by 90.
Comments
If you can't find the video, tag me (@SnapFireStudios), and I'll help you out.
- Thomas
Constrain Attribute: [self.Rotation] To: [vectorToAngle(self.Motion.Linear Velocity.X,self.Motion.Linear Velocity.Y)]
When up key is pressed
-- Change Attribute: [self.Rotation] To: [90]
-- Change Velocity, Direction: [90]
When left key is pressed
-- Change Attribute: [self.Rotation] To: [180]
-- Change Velocity, Direction: [180]
When down key is pressed
-- Change Attribute: [self.Rotation] To: [270]
-- Change Velocity, Direction: [180]
When right key is pressed
-- Change Attribute: [self.Rotation] To: [0]
-- Change Velocity, Direction: [0]