Random Actor changing his orientation toward another actor

nodixalnodixal Member Posts: 2
edited November -1 in Working with GS (Mac)
Hello, I was wondering if it was possible to make an actor oriented toward another actor. For example, i have random actors spawning all over the screen edges and moving to the center of the screen where another actor is, but i want their head to be aiming at the actor they are moving toward to.

Thanks!

Comments

  • PhoticsPhotics Member Posts: 4,172
    nodixal said:
    Hello, I was wondering if it was possible to make an actor oriented toward another actor. For example, i have random actors spawning all over the screen edges and moving to the center of the screen where another actor is, but i want their head to be aiming at the actor they are moving toward to.

    I describe how to do this in the artificial intelligence section of The Unofficial GameSalad Textbook. Basically... the "Rotate To" behavior can do it.

    The hero actor needs to broadcast its X & Y position to the other actors. (That's done with two constraints and a game or scene attribute.) The enemy actors can then turn to that position.

    Another way to do it is with VectorToAngle in a Rotate behavior.

    While building BOT, I had to play around with different behaviors because sometimes I got unexpected results... like actors turning when they shouldn't.
Sign In or Register to comment.