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. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Space Shooter 2D /w Cinemachine?

Discussion in 'Cinemachine' started by GilbertoBitt, Mar 28, 2018.

  1. GilbertoBitt

    GilbertoBitt

    Joined:
    May 27, 2013
    Posts:
    111
    i look and i wonder how i achieve same effect has space shooters 2D with cinemachine to "follow" character but keep him free to walk forward and backward too just locking only x or y for camera follow? example bellow.

    scramble_240.gif
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,208
    It looks like the camera is just moving at constant speed. What happens if you walk the player backwards off the screen?
     
  3. GilbertoBitt

    GilbertoBitt

    Joined:
    May 27, 2013
    Posts:
    111
    I achieve something similar but without cinemachine. using 2 rigidbody to move player and camera at same speed! but i'm afraid when i start using cinemachine this will generate some bug or problema becouse of the constant speed of the camera using rigidbody or do u think is only need to me deative the speed and let the cinemachine take controll? or the virtual camera of cinemachine override the camera movement?
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,208
    Rather than move the Camera with a RigidBody, move a CM Virtual Camera instead. Put "Do Nothing" in the Aim and Body sections, that way CM will not be trying to control the vcam itself. Then when you transition to other vcams there will be no interference or problems. The current active vcam will always drive the real Camera, which should be a separate GameObject in the root. It will transition seamlessly from one vcam to another.
     
    Last edited: Apr 6, 2018
    GilbertoBitt likes this.