How to rotate an actor to the center of a circle (possible sin & cos question)

scrapee_netscrapee_net Member Posts: 424
edited August 2012 in Working with GS (Mac)
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:

image

My actor can came from any direction to the circle, so, thats the harder part, I think.

Any idea?

Thanks in advance.

Comments

  • scrapee_netscrapee_net Member Posts: 424
    updated the tiltle - bump.
  • MotherHooseMotherHoose Member Posts: 2,456
    try:
    Constrain Attribute: self.Rotation To: vectorToAngle(x,y)
    x= orb's X … Y = orb's Y

    little demo in your Inbox

    image MH
  • scrapee_netscrapee_net Member Posts: 424
    I got it... I found this video


    Thank you Mother Hoose, also. The solution is very similar to what you wrote.
Sign In or Register to comment.