How should I use the `FreeLookCam` script located in the standard assets folder
Hi there all. I am totally new to unity (not new to programming c# though) and I was trying to make a free look camera (like when you die in counter-strike game) and I ran into the standard assets pack and its camera scripts. I wanted to use the FreelookCam
c# script and what I did was added the script to the main camera. But it gives me a NullPointerException
in line 37 which is:
NullReferenceException: Object reference not set to an instance of an object UnityStandardAssets.Cameras.FreeLookCam.Awake() (at Assets/StandardAssets/Cameras/Scripts/FreeLookCam.cs:37)
After trying to find a documentation for this script (and failing) I decided to see the code itself and look for helpful comments and at the first lines there is comment saying:
//This script is designed to be placed on the root object of a camera rig,
//comprising 3 gameobjects, each parented to the next:
// Camera Rig
// Pivot
// Camera
so my "guess" was that I should create a Camera Rig gameobject, a Pivot gameobject and finally a Camera gameobject. While I can pretty easily create a Camera gameobject (by going to GameObject -> Camera), I have no idea how to create the rest.
Any help regarding my help is appreciated. Thanks in advance
Your answer
Follow this Question
Related Questions
Custom Camera Script Toggle Enabled / Disabled 2 Answers
Script able to target two cameras? 0 Answers
Object appears to glitch as it moves whenever the camera follows it. 0 Answers
Making a pivot focused game 0 Answers
c# - error CS0103: The name `hit' does not exist in the current context (cardboard switching) 1 Answer