Hi,
does somebody of you know, how to get access to the Camera that is attached to a First Person Controller. I’ve stored my FPC in a variable of type “GameObject” and now I want to set the angles of the Camera to zero.
Thank you!
Hi,
does somebody of you know, how to get access to the Camera that is attached to a First Person Controller. I’ve stored my FPC in a variable of type “GameObject” and now I want to set the angles of the Camera to zero.
Thank you!
Assuming you have added the the Firt Person Controller from Standard Assets attach the script to the First Person Controller and then you can use this (in JavaScript):
var cam = transform.Find("Main Camera").gameObject.GetComponent(Camera);
or
var cam = GameObject.Find("First Person Controller/Main Camera").GetComponent(Camera);