Hey peoples. I have a code that makes an mc turn left/right when the main character mc passes a certain distance from it. Imagine a person’s head turning to follow the hero… Well it works just fine when the npc and hero are on the same level, but when I put the npc inside another mc the code turns off for some reason. Can anyone please explain why? Thanks-
onClipEvent(enterFrame){
if(this._x < (_root.hero._x - 65)){
this. _xscale = -100;
}
if(this._x > (_root.hero._x + 65)){
this. _xscale = +90;
}
}