[Solved] Spawn actor, "set it and forget it" (Move To behaviour)

mhedgesmhedges Raised on VCSMember Posts: 634
edited December 2014 in Working with GS (Mac)

Hello -

I have an actor which should spawn and move to wherever you click the mouse. Several instances of the actor should be able to be spawned (not once per screen, or not once until actor is destroyed).

The problem with my existing code is that when an actor has been spawned and moves to a target x,y , if another actor is spawned, both actors move to the new target x,y as opposed to "actor 1 first instance" going to x1,y1 and "actor 1 next instance" going to xn,yn (where n is whatever mouse click number).

In other words, how can I lock out a previous actor from going to the new mouse click x,y? Boolean, self variables, other?

Thanks, regards.

Comments

  • mhedgesmhedges Raised on VCS Member Posts: 634

    Figured it out

    The actor (prototype) needs two "self" variables, x and y.

    When you click on the mouse at some x,y , you change the actor's x,y to the mouse's x,y. Set it and forget it!

Sign In or Register to comment.