PlaceholderGames / 2022-yr2-team-gemini

Second CS2S561 Game
0 stars 0 forks source link

Head Camera #60

Open 30001606VA opened 2 years ago

30001606VA commented 2 years ago

I added a head camera to the project:

image

I made it a bit complicated at the beginning which I scrapped because not only was it complicated but it didn't work :)

So now there is a "Camera" object on the player that is default set to "inactive". What happens is when you walk to the table with the camera on it, it will prompt you to press 'E' to pickup. When you press 'E' it will set the camera on the table to "inactive" and set the camera on the player to "active". On top of that, the camera pickup script accesses the "switchCameras" script to run a function which adds the head camera to the cameras list.

Possible addition: Make the head camera accessible before picking it up but again cover it. I only didn't add this because the Canvas I added to the head camera was buggy, so I worked around it by making it inactive until you pick it up.

The code in case you're interested:

"pickupCamera.cs":

image

"switchCameras.cs":

image

30001606VA commented 2 years ago

Added a bug fix for the head camera. I just forgot to set the culling mask to the head camera, so the head camera was able to see both red and blue objects.