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

How to create a cinemachine custom camera offset in the aiming direction

Discussion in 'Scripting' started by esiorbmA, Oct 4, 2021.

  1. esiorbmA

    esiorbmA

    Joined:
    Dec 1, 2020
    Posts:
    9
    Hello,

    I am currently working on a top-down shooter game for mobile devices.

    I use two dynamic joystics:
    1. to control the player movement
    2. to control the turret canon direction.

    I am using a cinemachine virtual camera to follow my player.

    I'd like to create a subtle camera offset in the aiming direction when my player is shooting.

    (Something like in this game:
    . See how the camera moves when the tank is shooting)

    any idea on how to achieve that?

    Thank you very much for your help
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,722
    Looks like just a vCam that follows the targeting reticle or projectile.
     
    Last edited: Oct 5, 2021
    Gregoryl likes this.
  3. esiorbmA

    esiorbmA

    Joined:
    Dec 1, 2020
    Posts:
    9
    I'd like to create an empty gameobject which position moves in the joystick's direction, with a max distance from the player. I'll plan to asign this gameobject to the " to follow" in the Vcam settings. I tried many things but I am now stuck with the script