How to view from camera?

Forgive me since I am new to the Core game engine.

I believe I know to how create a camera onto the scene (Gameplay Objects -> Camera); I just want to know how to change to camera view.

If you want to test your camera view without coding, you can select the camera in the Hierarchy and turn on, "Use as Default"
Screenshot_58

Keep in mind, Core by default gives you a camera so you'll need to turn it off before your camera above shows.

Screenshot_59

To code a camera switch in lua. You can utilize the override camera feature and do something like this:

local CAMERA_TO_CHANGE_TO = script:GetCustomProperty("CameraToChangeTo"):WaitForObject()
local localPlayer = Game.GetLocalPlayer()

Task.Wait(1) --just delete if you want it to immediately override, this is to help show the before/after
localPlayer:SetOverrideCamera(CAMERA_TO_CHANGE_TO)

And then once you want to go back to your default camera you can just clear the override:

localplayer::ClearOverrideCamera() 

Here's what it looks like within the hierarchy, make sure you add a core object custom property and then drag in the camera object:

1 Like