ooh that makes sense, thank you very much, that fixed the background issue but ive been messing around with the code that follows the player.
This is the code in the player script:
msg.post("@render:", "use_camera_projection")
msg.post("camera#level1", "acquire_camera_focus")
msg.post("camera#level1", "follow")
self.follow = true
function on_input(self, action_id, action)
if action_id == hash("touch") and action.pressed then -- <4>
self.follow = not self.follow
if self.follow then
msg.post("camera#level1", "follow")
else
msg.post("camera#level1", "unfollow")
end
end
end
and this is the code in the camera script:
function on_message(self, message_id, message, sender)
if message_id == hash("follow") then
go.set_parent(".", sender)
go.set_position(vmath.vector3(512, 382.5, 0))
elseif message_id == hash("unfollow") then
go.set_parent("camera#level1", nil, true)
end
end
One problem i’ve encountered that when i use the camera projection the camera doesn’t centre the player in the middle of the screen. I did some tinkering and found that when i changed the FOV it looked like it did not focus on the player but a random point in the screen. So i looked at the code and thought the code below was renpossible for setting the focus of the camera I changed the coordinates from -360, -360, 0 to 1/2 of my aspect ratio (1024x765) which makes it 512, 382.5, 0. This also didn’t change anything, lastly i set it to the URL of the character sprite but this also didn’t do anything. Do you guys know what could cause the camea to be focused so only 1/2 of the level is on the screen?
go.set_position(vmath.vector3(512, 382.5, 0))