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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

3D LOOK DOESNT WORK HELP!!

Discussion in 'Scripting' started by killers12342, Feb 1, 2020.

  1. killers12342

    killers12342

    Joined:
    Sep 11, 2017
    Posts:
    4
    using this code my screen only shakes when i try to move my mouse to look, i tried putting "+=" on lines 24 and 25 but it became an error, please help.
    upload_2020-2-1_15-28-36.png
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,594
    Of course you will get error, as you try add value to unassigned variables.
     
  3. killers12342

    killers12342

    Joined:
    Sep 11, 2017
    Posts:
    4
    yes so how do i get the script working
     
  4. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,594
    Try define float MouseX/Y outside Update scope and initialize, in mouselook class.
    Then inside Update you can use +=

    Either way, you should look to source, where you got script from.