Hi everyone.
im having trouble finding a way to write a little bit of code that will control all of my npc’s stopping when they bump into each other (the actual stoping and letting each other past im not worrying about yet.) its just the getting them to stop when they bump into each other, without me having to write the same bit of code to refer to each npc i have on the level.
this code is inside each npc’s mc:
onClipEvent (enterFrame) {
if (this.hitTest(_parent._parent._parent.[COLOR="SeaGreen"]"another npc"[/COLOR])) {
_parent._parent.collisionEngine.gotoAndPlay(2);
}
}
obviously that doesnt work, but i was wondering if anyone knew a way refer to all npc’s mc’s within a certain mc.