Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
VRfriend2016X's avatar
10 years ago
Solved

How do you make a character's head LOOKAT YOUR HEAD?. Not only his body face you

There's a LOOKAT function in unity i'm not exactly sure how to use it. I used to know but haven't developed in a while .But i want to use that to make the character who would be shorter or taller than me face me with his head pointing at mine. I would guess he would be pointing at my oculus rift camera. How do i do it?

Becaise most examples out there just make objects LOOKAT other objects, in other words turn their whole facing towards them BUT they dont specifically tackle the issue of tilting the head up
  • Well thanks all but i found the solution. I found a free script in Unity called Head   HeadLookController. I tried and tried modify the demo by including my own character who is taller than the other one.  IN the original Demo the character just faces whatever position you move a Tarbet light at. But i replaced that with my own character. And i made alittle trick, i put like VR goggles on him to make it easy to get the position of the eyes of the figure. just by

    Ray cursorRay = Camera.main.ScreenPointToRay(GameObject.Find("VRGogglesSimulator").transform.position);
    My VRGoggglesSimulator is the game of a cube i used as goggles and which i parented to the face of the tall character.

    Anyways now i move the character wherever....higher, lower, and head level  and wherever the goggles go..the other character looks at him. :)  Awesome. I'm just a hobbiest. Not that good at programming but i figured it out cause i needed this feature so much.

2 Replies

Replies have been turned off for this discussion
  • Well thanks all but i found the solution. I found a free script in Unity called Head   HeadLookController. I tried and tried modify the demo by including my own character who is taller than the other one.  IN the original Demo the character just faces whatever position you move a Tarbet light at. But i replaced that with my own character. And i made alittle trick, i put like VR goggles on him to make it easy to get the position of the eyes of the figure. just by

    Ray cursorRay = Camera.main.ScreenPointToRay(GameObject.Find("VRGogglesSimulator").transform.position);
    My VRGoggglesSimulator is the game of a cube i used as goggles and which i parented to the face of the tall character.

    Anyways now i move the character wherever....higher, lower, and head level  and wherever the goggles go..the other character looks at him. :)  Awesome. I'm just a hobbiest. Not that good at programming but i figured it out cause i needed this feature so much.