•• Actor facing its direction? howz!? ••
I have a scene with an actor that moves around colliding with other actors making it move to other directions, and having an actor face to the left and moving to the right just seems wrong and a bit retarded..
So.. Can anyone help me to make the actor change its self.rotation to the direction he is moving towards? (I dont only mean up, left, down and right. I need all directions)
I have thought of this so far:
Constrain Attribute:
Self.rotation to:
vectorToAngle( self.Position.X - 140 , self.Position.Y - 240)
It doesn't work.. Does anyone know if thats completely wrong or just needs some adjustments?
So.. Can anyone help me to make the actor change its self.rotation to the direction he is moving towards? (I dont only mean up, left, down and right. I need all directions)
I have thought of this so far:
Constrain Attribute:
Self.rotation to:
vectorToAngle( self.Position.X - 140 , self.Position.Y - 240)
It doesn't work.. Does anyone know if thats completely wrong or just needs some adjustments?
Comments
direction random(1,360)
This problem happens because the "self.direction" angle attribute I made on the actor is equal to the direction it has when it spawns and doesn't change.
Now I can only think of the solution to the problem is to use the function "vectorToAngle" but I am not quite sure how to use it..
Does anyone know how to fix this?
As always tshirtbooth solves the problem, thanks!