Colliding with all instances except one
Hi!
I have an actor X - I use many instances of it inside the scene. Player can choose one of them, and move within the scene.
When he chooses one of the instances, new bigger actor (Y) appears, and move with the chosen instance of X actor.
This Y actor is supposed to check if it collides with other inctances of actor X. But he also responds to the chosen instance (and he should not). I have no idea how to do it that way, so Y actor reacts with all instances of actor X, except the chosen one.
Any ideas?
I have an actor X - I use many instances of it inside the scene. Player can choose one of them, and move within the scene.
When he chooses one of the instances, new bigger actor (Y) appears, and move with the chosen instance of X actor.
This Y actor is supposed to check if it collides with other inctances of actor X. But he also responds to the chosen instance (and he should not). I have no idea how to do it that way, so Y actor reacts with all instances of actor X, except the chosen one.
Any ideas?
![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
Best Answers
-
ericzingeler Posts: 334
I would do something like this:
In Game Layer:
Create a attribute called "ActiveCollideActorX"
Create a attribute called "FollowingActor"
In Actor X:
1. If you don't already have one, create an attribute called "MyID". Then Insert a unique Integer into this attribute for each instance. Or rename each instance to a unique integer. You just need something in the instance that says "Hey, I'm different from everyone else!"
2. Create a rule that says if collide with Actor Y, change Game Attribute "ActiveCollideActorX" to "MyID" or "Name" (depending on what you did prior).
In Actor Y:
1. In your collide rule, add if "ActiveCollideActorX" = "FollowingActor", don't do that.
So....
Now somewhere I assume you have a rule that will make actor Y follow actor X instance. In that rule, change Game Attribute "FollowingActor" to the "MyID" or "Name" of the actor instance that is to be followed. -
MotherHoose Posts: 2,456
@TheMoonwalls
don't know what happens when your actorY collides with other actorXs
but, one very simple way to track any selectedInstance
… without adding more attributes to the game or the actor:
demo: http://www.mediafire.com/download.php?63neeimlu5m6oz3MH
Answers