Camera setting wrong

In the game im making im using a camera to follow the players movements. The only scripting i used was in the players script and is:

function final(self)
	msg.post(".", "release_input_focus")
	msg.post("camera", "release_camera_focus")
end

and

function init(self) --this function runs when the level begins
	msg.post("camera", "acquire_camera_focus")
end

do you know what settings i need to change in the camera to get it to follow the player in the centre of the screen?
This is what is looks like from the build window: the player is in the bottom left of the screen out of view (the enemy npc is in the screen btw)

1 Like

The easiest way is to follow the example:

There’s nothing stopping you from attaching camera component as a child to player’s game object if you would like a very strict, immediate following :wink: In the example it is dynamic (you are setting parent on message “follow”), but I usually attach it simply in the game’s collection hierarchy even

3 Likes

I just ended up using a camera object under the player object and attached the camera file. I then set the x and y coordinated to 1/2 of the display size. It somehow worked lol

1 Like