Im wanting to write a first person camera and I need to access the camera component on the gameobject this script will belong to. I know there’s already a first person camera set up out there. But you don’t learn anything by just copy and pasting. However I did look at the first person camera set up that comes with Island demo and its hard to follow how the code works. Can someone help me out?
What do you need to access the camera component for?
Typically you’d access the camera component if you needed to change camera parameters such as field of view and so on. If you’re just wanting to implement a control scheme of some sort (e.g. classic ‘FPS camera’ movement), that won’t involve the camera component directly. (Rather, it will involve other components, such as the transform component or the ‘character controller’ component.)