Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Third person shooter multiple cameras with different positions not pointing toward same

Discussion in 'Cinemachine' started by Kiket1995, Jul 27, 2023.

  1. Kiket1995

    Kiket1995

    Joined:
    Nov 12, 2018
    Posts:
    4
    Im doing a third person shooter using Cinemachine package. Now I have 3 cameras, one for view from behind of character, one for over shoulder view and one for sniper scope zoom. Each camera has different offset. This offset is causing cameras to aim at different points. Thing is, I know that changing offset only on forward axis, would fix this issue, but then all the cameras, have to be on same X,Y position, which is not what I want. I saw many TPS games are having their camera pointing same spot regardless of current camera position. All the cameras are focused on same follow transform and all are using 3rd person follow. Is there any solution by code, or by using proper cinemachine camera's setup to force cameras always point same spot independent of current camera position?



     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,206
    Yes, that's one reason why LookAt and Follow targets are separated. You can create an invisible object to serve as the aim target for all cameras, and have some code to manage its position. Then, put a Composer in the Aim section of the vcams, with the aim target object as the LookAt target. You probably won't want to use 3rdPersonFollow in the Body of all the cameras. Try Transposer instead.
     
  3. Kiket1995

    Kiket1995

    Joined:
    Nov 12, 2018
    Posts:
    4
    Already tried to do that but with HardLookAt Aim option instead of composer. It made camera focused more on LookAt target than on Follow target and camera was rotating around aim target instead of character. Maybe Composer will do the job. Thank You for response.
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,206
    Isn't that what you want? You said that all the cameras should point to the same place, regardless of their position. Maybe you can describe a little more specifically the precise behaviour you want.