# Why won't this work inside an mc?

**URL:** <https://forum.kirupa.com/t/why-wont-this-work-inside-an-mc/275877>\
**Category:** Uncategorized\
**Created:** [November 19, 2008, 6:19pm UTC](https://forum.kirupa.com/t/why-wont-this-work-inside-an-mc/275877 "2008-11-19T18:19:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jolteon77](https://avatars.discourse-cdn.com/v4/letter/j/3ec8ea/32.png) [@jolteon77](https://forum.kirupa.com/u/jolteon77)\
**Post date:** [November 19, 2008, 6:19pm UTC](https://forum.kirupa.com/t/why-wont-this-work-inside-an-mc/275877/1 "2008-11-19T18:19:01Z")

</div>

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;  
}  
}
