Constraining area

rollorollo Member Posts: 15
Hi there,
I have a problem. In my game i have a certain amount of soldiers that can spawn into a battlefield. each one spawns an actor that is constrained to it. I am trying to get it so when the enemy collides with the actor constrained to the soldier. the soldier moves towards that enemy. Any Ideas? Thanks.

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    You have to make sure that the constrained actor and the constraining actor share an attribute value (e.g. self.ID set to an integer), as in my demo here: http://forums.gamesalad.com/discussion/comment/384027/#Comment_384027. That way, you can broadcast (via a game attribute) the self.ID of the enemy and the enemy can have a rule that checks to see if its self.ID matches game.ID... and if so, broadcast its position x/y to game attributes that the soldier moves towards.
  • rollorollo Member Posts: 15
    Oh ok thanks! Which one of your demos are you refering to?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    When you click on that link, it takes you to the post I referenced (Health bars for each enemy).
  • rollorollo Member Posts: 15
    ok Thanks!
Sign In or Register to comment.