Search Unity

Cinemachine 'free look' - lock mouse and more

Discussion in 'Cinemachine' started by jeroll3d, Nov 28, 2021.

  1. jeroll3d

    jeroll3d

    Joined:
    Nov 6, 2010
    Posts:
    249
    Hi guys

    First, I'm sorry for the lack of knowledge, but I'm learning. I made a mini prototype of a character with a 3d view, it moves according to the orientation of the camera. However, I would like to add a few things that I describe below:

    - mouse lock - when I click the right mouse button anywhere on the screen, the mouse 'pointer' disappears and/or reappears. However, when disappearing and reappearing, it is always properly centered on the screen (it automatically centers itself on the screen) and limited by it when the player is active (playing).

    - free mouse - when the mouse pointer reappears, without character interaction, I can move it freely around the screen (limited by it) to use on other objects (like touching a door and opening that door, etc). Of course, I don't go into details about the subsequent actions which the mouse will perform as it is not the object of the questions.

    This idea is used in many rpgs, games mmos, etc.

    I use 'playmaker' (I ask in this forum because I would like to know if there is any extension' which I can add via 'cinemachine' that makes this work easier).

    obs. its the same ideia or mechanic what we hav in Starter Assets - Third Person Character Controller
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    This really isn't a Cinemachine question. I think you have a better chance of getting a useful answer if you post on the general scripting forum: https://forum.unity.com/forums/scripting.12/

    Alternatively, since you see what you want in the Starter Assets, you can try looking at the code inside it to find out how they do it.