- Home /
Is it possible to rotate a child object regardless of the parent rotation ?
Hi to all
In my game i have a npc model that control by a script which use unity navmesh for navigation . my npc has a child game object with name "AIHead" for controling npc head.i want my npc be able to look at other gameobjects(i.e. enemy)by rotating her/his head since itself goes in different direction. Is it possible by this line of code:
Headobject.lookat(target.position);
With something this simple, just try it. Note the function name is 'LookAt' not 'lookat'.
Answer by azmundai · Jun 05, 2013 at 04:55 PM
you have to either attach a script to the head object itself, or lookup the child with transform.FindChild()
Your answer
Follow this Question
Related Questions
2D Sprite Rotation 0 Answers
Rotate with joystick - LookAt axis flipping 1 Answer
How can i follow an object by 1-axis-rotation? 0 Answers
slowly rotate a object *need quick fix* 0 Answers