I am trying to make a character(1) follow another character(2) and when character(1) gets close enough to stop moving. The problem is , is that movment of the character (movie clip plays action) only works some times. Does anyone have any idea how to change it so it works.
//follow the character with movment onClipEvent (enterFrame) { if (this._x<_root.player._x && _root.player._x-this._x<100 or this._x>_root.player._x && this._x-_root.player._x<100) { _root.sven.sven_body.sven_body_sword.sve nviking_sword_walking.gotoAndPlay("stop" ); _root.sven.sven_legs.gotoAndPlay("stop" ;
} else { if (this._x<_root.player._x && _root.player._x-this._x>=300 or this._x>_root.player._x && this._x-_root.player._x>=300) { _root.sven.sven_body.sven_body_sword.sve nviking_sword_walking.gotoAndPlay("walk" ); _root.sven.sven_legs.gotoAndPlay("walk" ; }