Search Unity

XCOM style tactical camera set up

Discussion in 'Cinemachine' started by deab, Sep 15, 2017.

  1. deab

    deab

    Joined:
    Aug 11, 2013
    Posts:
    93
    I've been testing Cinemachine and very impressed! I wonder if I could ask for the best approach to set up the following camera (much like the unit control in XCOM):
    • fixed angle looking down (eg 45 degrees) at the target
    • when the target is changed (swapping between units) the camera should just move to the new target without changing the aim
    • player can rotate the camera 90 degrees around the current unit on the Y axis (ie circle around the target)
    I've tried a single VirtualCamera. Setting Aim to 'Hard Constraint' and clearing the 'Look at' field deals with the aim swinging around when swapping units, but I can't see how I would allow the player rotate the camera. Is this the correct approach? And if so, how can I control the rotation?

    I'm also unsure of the best Body Binding Mode for this set up, 'Lock to target no roll' I've used so far.

    Thank you!

     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    @deab First of all you should use the CM2.1 beta, if you're not already doing so. It has a new kind of Body component, the FramingTransposer, which is exactly suited to your purpose. It allows you to have sophisticated compositional controls with a constant camera aim.

    Using the Framing Transposer, the vcam's transform rotation defines the angular relationship to the target. For what you describe, set its X rotation to 45 degrees. To rotate the camera around the target, just rotate the vcam's transform around world Y. CM doesn't provide this out of the box, but it would be very easy for you to make a little script to do it.

    Get the 2.1 beta here: https://forum.unity.com/threads/cm-...tures-new-fixes-improvements-examples.491278/
     
    Last edited: Sep 15, 2017
  3. deab

    deab

    Joined:
    Aug 11, 2013
    Posts:
    93
    @Gregoryl thanks for the prompt reply, I've pm'ed you as I'm seeing some strange results and thought the project may be helpful.