Search Unity

Question How can I look at target with virtual camera but the camera should be on player head ?

Discussion in 'Cinemachine' started by JhonRA77, Sep 15, 2021.

  1. JhonRA77

    JhonRA77

    Joined:
    Sep 9, 2021
    Posts:
    51
    I mean that the view should be from my view but the look at the camera should be the player head the player is a third person.



    The player is the kid_from_space

    The basketball is the Target child gameobject. This basketball is rotating around the player.

    What I want to do is that the player will look at the basketball but to keep the view from my view like it is in the screenshot. I want to keep see the player a third person view but that player will look at the target not me not from my view.

    Maybe yo put the virtual camera as child of the player ? but still it will rotate the my view camera at the target not the player.
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    I'm not too sure I understand what you want.

    It sounds like you want a 3rdPerson camera following and looking at the kid. You don't want the camera to change when the kid rotates. The kid turns to look at the basketball. Is that right?

    If so, then you probably want a 3rdPersonFollow vcam on the kid. You want to decouple the kid's rotation from the camera position. The basketball is not relevant to the camera. You can see how to do that in this tutorial:

     
    JhonRA77 likes this.
  3. JhonRA77

    JhonRA77

    Joined:
    Sep 9, 2021
    Posts:
    51
    No what I want is the virtual camera to be parent of my player head and than using another regular camera.

    Here is a screenshot :
    And I will explain :

    The virtual camera CM vcam1 is parent of my player head.
    The virtual camera Look At is set to the Target(basketball).

    At the bottom I have another regular camera.

    The result is that I keep looking from the forward on the scene and the player head is rotating looking at the basketball.



    Here is a very short video clip I recorded showing what I wanted to do and that is working so far :

    It's not perfect you can see in the end the player head is getting almost broken. but this is the idea in general of my goal. The player is looking at the target the third person character.

    I need to find how to clamp the head rotation how to make that another virtual camera will stay looking at the scene like the regular camera or just stay with the regular camera for this. but this is what I'm trying to do :

     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    JhonRA77 likes this.