How to make an actor point at another actor

awssassimawssassim Member Posts: 3
edited November -1 in Working with GS (Mac)
hii everyone.

i got this problem now, i have got an actor(Rocket) and i got another object which i want the rocket to hit.

the object might come from any direction so the rocket must move and hit it at certain time, i have managed to solve the moving part using moveTo and constrain global attributes. But my problem now is how to rotate the rocket in such a way that it will point to the object and fly towards it?.

thanks.

Comments

  • iDeveloperziDeveloperz Member Posts: 1,169
    You can make it 'move to' Object2.x & Object2.y

    Then constrain an attribute. (I can't say witch one on the top of my head.)

    Ill check now.
  • awssassimawssassim Member Posts: 3
    i do not think it is as simple as that, there must be some sort of 2d maths involved
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi awssassin, luckily maths can be avoided here: use the Rotate to Position Behaviour, putting the x and y coordinates of the actor you're rotating to, in it.

    :-)

    Edit: you beat me to it!

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • iDeveloperziDeveloperz Member Posts: 1,169
    No I haven't .

    I forgot to rotate.

    ---Edit---

    Ok I sort of done it. But Im not sure how to do it properly. Maybe Gyroscope can say what I done wrong.
  • awssassimawssassim Member Posts: 3
    wowowow this game salad is amazing man.

    thanks for the help, i was about to commit math attack :).

    thanks gyroscope.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    iDeveloperz said:
    I forgot to rotate.

    What, yourself, or the actor? ;-) (It's alright, I'm the only one who thinks I'm funny!) Seriously, glad it's sorted for you.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • iDeveloperziDeveloperz Member Posts: 1,169
    THERE IS A ROTATE TO POSITION BEHAVIOR?

    KELIJFIKLO"DMSKLWEJMOL!
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    iDeveloperz said:

    KELIJFIKLO"DMSKLWEJMOL!

    DGOET DGPOEG WEF MFWEFJK SDF?

    FINALLY, SOMEONE ELSE WHO CAN SPEAK ALPHA CENTAURIAN!

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • iDeveloperziDeveloperz Member Posts: 1,169
    You should have asked, I've known it for years.

    COOL LOOK WHAT I MADED!!!

    http://gamesalad.com/game/play/45517

    :D
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    That's neat! Make the red block an animated dog and that could be a winner! :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • jstrahanjstrahan Member Posts: 498
    Give ur actor a finger to point with
    Lol
  • iDeveloperziDeveloperz Member Posts: 1,169
    It could be a cat chasing...

    THE MOUSE! as in the computer mouse.

    Shut up. My mum thinks i'm funny.

    ;)
Sign In or Register to comment.