Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Nominations have been announced for this years Unity Awards. Celebrate the wonderful projects made by your peers this year and get voting! Vote here!
    Dismiss Notice
  6. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

First person camera

Discussion in 'Cinemachine' started by a-t-hellboy, Nov 21, 2018.

  1. a-t-hellboy

    a-t-hellboy

    Joined:
    Dec 6, 2013
    Posts:
    83
    Hey there,

    I'm creating the FPS game which it has full body awareness feature like Mirror's Edge.
    And like any FPS games the body is rotated according to camera look so I put my virtual camera in player gameObject.
    This is my setup:

    upload_2018-11-21_23-48-14.png

    As you see there is no rotation in horizontal axis in the camera because actually it is rotated in this axis by player rotation.
    But now I want to put this virtual camera out of the player gameObject and has that previous result which I just explained.
     
    Last edited: Nov 25, 2018
  2. a-t-hellboy

    a-t-hellboy

    Joined:
    Dec 6, 2013
    Posts:
    83
    Anyone ?
     
  3. LurkingNinjaDev

    LurkingNinjaDev

    Joined:
    Jan 20, 2015
    Posts:
    1,906
    No one answered because probably no one understands what is your question. At least I don't, that's for sure.

    If you want an effect back, change back whatever you have changed. Other than that, you may need to rephrase your question.
     
  4. a-t-hellboy

    a-t-hellboy

    Joined:
    Dec 6, 2013
    Posts:
    83
    I made some changes in my post. Check it out please.
     
  5. LurkingNinjaDev

    LurkingNinjaDev

    Joined:
    Jan 20, 2015
    Posts:
    1,906
    I still don't get it. When your body is rotating, you just match the rotation on the camera. Or I still don't understand what you're asking for.
     
  6. a-t-hellboy

    a-t-hellboy

    Joined:
    Dec 6, 2013
    Posts:
    83
    How should I match the rotation on the camera ?
    How should I match the rotation on the camera ? (I don't use Unity Input Manager, I use Rewired)
     
  7. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,831
    I also don't understand your question, or what you're trying to do.

    Why do you want to unparent the vcam from the player? If you want the mouse to control player rotation, then make a script to do that. If the vcam is parented to the player, with "do nothing" in Aim and Body, it will exactly follow the player.
     
  8. a-t-hellboy

    a-t-hellboy

    Joined:
    Dec 6, 2013
    Posts:
    83
    Because I want to transit from my third person camera to first person camera and vice versa. Also there are 2 player gameObject, one for third person and another for first person. Because of this I want to put my first person camera out of player gameObject and sync player rotation and first person camera rotation.

    Also I use Rewired for input managing and player rotation depends on mouseX axis and speed parameter. I want my camera rotation speed same as player rotation speed (Typical FPS game)
     
  9. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,831
    Sounds like you need 2 vcams: one for FPS and one for TPS. Activate one or the other, according to the mode you're in. Let Cinemachine do the blending for you. Keep the FPS camera inside the player GameObject.
     
  10. a-t-hellboy

    a-t-hellboy

    Joined:
    Dec 6, 2013
    Posts:
    83
    @Gregoryl By keeping it in player GameObject how I should enable and disable player GameObject for TP and FP mode ? (For TP it is out of player GameObject)
     
  11. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,831
    You don't have to disable the entire Player gameObject. Just the FPS child when you enter TPS mode.
    I don't really know how you've set things up, but assuming it's like this:

    Camera
    - brain

    Player
    - FPS controller
    - vcam

    TPS controller
    - vcam

    For FPS mode disable the FPS controller component (including its vcam) and enable the TPS gameObject.
    For TPS mode do the opposite.