How to rotate an actor to the center of a circle (possible sin & cos question)
scrapee_net
Member Posts: 424
I don't know what would be the best title for this, but this is what I need. Once my actor is closer than X pixels of the circle, it will be accelerated to the circle. I'm using magnitude to check the distance. This part, of accelerating it to the circle is also working all right. What I can't find a solution, is how to rotate the actor, to make its feet to touch the circle. Like in this sample image:
My actor can came from any direction to the circle, so, thats the harder part, I think.
Any idea?
Thanks in advance.
My actor can came from any direction to the circle, so, thats the harder part, I think.
Any idea?
Thanks in advance.
Comments
Constrain Attribute: self.Rotation To: vectorToAngle(x,y)
x= orb's X … Y = orb's Y
little demo in your Inbox
MH
Thank you Mother Hoose, also. The solution is very similar to what you wrote.