How to save a rotation to position?

i want to change an actor image depend on the position where he is going,
im using 2 different actor, one for record in a game.attribute the self.rotation to position X,Y.
I would like to use only an actor.
sorry for my bad english. thank you for help
im using 2 different actor, one for record in a game.attribute the self.rotation to position X,Y.
I would like to use only an actor.
sorry for my bad english. thank you for help
Best Answer
-
MarkOnTheIron Posts: 1,447
Then don't rotate the actor.
To check the direction use the vectorToAngle expression and use that to change the image.
Answers
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
mine is a monster that go to the hero, so i cant rotate it
is it just a rotation position?
remember in coding it usually When then What
so drag in a Note behavior
type in it:
When: self X = ? ; Y = ?
What: change self image
now you see you have to create a rule:
Rule: when (All)
Attribute: self.Position.X ≥ (moving right; or ≤ if moving left) the X you want for change
Attribute: self.Position.Y ≥ (moving up; or ≤ if moving down) the Y you want for change
--changeAttribute: self.Image To: the image you want
I used like said FryingBaconStudios the rotation to position then the change image relative at the self position, i can modify the images but still don't know if possible to save the rotation in an attribute. ( i dont understand very well the attribute function, just few of those)
drag a Display Text behavior into the rotatingActor
Text: Expression: self.Rotation … or floor(self.Rotation) for no decimals
on rotatingActor:
(lower the rotationSpeed so you see the Rotation place for your imageChange )
Rule: when
Attribute: self.Rotation ≤ number for change
--changeAttribute: self.image To: whatever
simple demo of this: http://www.mediafire.com/?444f728uofg1we1
vectorToAngle(x-x',y-y')
first then open this discussion i used it
vectorToAngle(x,y) whit Hero X,Y and obviously it doesn't work..
so thank you all
in Rotation: Vector to Angle is the same as Rotate to Position
and moveTo can also get you the end points of that vector
little demo: http://www.mediafire.com/?rdoj0dvbzbz9bs3