I seem to have stumbled across a really strange error. I have copied the example camera module from the examples page to track the player, and have followed the instructions perfectly, and checked for typos, but I cant seem to get it to follow the player.
function init(self)
msg.post("#camera", "acquire_camera_focus")
end
function on_message(self, message_id, message, sender)
if message_id == hash("follow") then
go.set_parent(".", sender)
go.set_position(vmath.vector3(-360, -360, 0))
elseif message_id == hash("unfollow") then
go.set_parent("camera", nil, true)
end
end
function init(self)
msg.post(".", "acquire_input_focus")
msg.post("camera", "follow")
self.follow = true
self.moving = false
self.firing = false
self.input = vmath.vector3()
self.dir = vmath.vector3(0, 1, 0)
self.speed = 150
self.damage = 1
end
function final(self)
msg.post(".", "release_input_focus")
end
function update(self, dt)
if self.follow == true then
msg.post("camera", "follow")
end
this is a really weird error, tbh it could be some logic program elsewhere in my code, but to save debugging time I wanted to post it here in case I missed something.