Angle actor 1 image to face actor 2
dereklarue
Member Posts: 121
Im fairly new with GS, so I'm running into a few problems that I'm not sure how to face..
Ok so I'm using global Attributes PlayerX and PlayerY on Actor 2 (Constrained of course),
So, my question is...
How do i get Actor 1's image to always face actor 2?
btw...Actor 1's image is facing to the right, (think thats 0 degrees for GS?)
Thanks in advanced.
Ok so I'm using global Attributes PlayerX and PlayerY on Actor 2 (Constrained of course),
So, my question is...
How do i get Actor 1's image to always face actor 2?
btw...Actor 1's image is facing to the right, (think thats 0 degrees for GS?)
Thanks in advanced.
Comments
Guess i could askin him/her...
thanks
In that template, the cannon always rotates towards the mouse. You could replace the mouseX and Y with the actor you want to face X and Y...
if i understand you correctly, you'll want to save the x/y values of the target actor to constrained, game level attributes. so that they maintain the actors data when it moves.
then you will place these values into a 'rotate to position' behavior in the actor you want to rotate. http://gamesalad.com/wiki/behaviors_reference:rotate_to_position
the behaviors section http://gamesalad.com/wiki/behaviors_reference and the wiki itself
http://gamesalad.com/wiki/start
are always the best place to start looking for solutions. that way, you will have a better understanding of what you are implementing and why. as opposed to just being told 'do this or do that'.
this is a great community and they will usually show you where the information comes from, so you can investigate it yourself for better understanding.
hope this helps. if it is not what you are looking for, let us know.
noodles...
using Global PlayerX, PlayerY constrained to Actor 2
In Actor 1:
Rotate to position:
game.PlayerX , self.position.X
game.PlayerY , self.position.Y
Thanks guys!
excellent. i couldn't have said it better my...oh wait...lol
noodles...