I want a make a missile which will follow the player, the creating part is ok. However, I can’t make missiles move towards player’s position. How can I do it? I played with the code little bit like changing the dir property to player’s position but not works… Here is an example of my move script
function update(self, dt)
if self.moving then
local pos = go.get_position()
pos = pos + self.dir * self.speed * dt
go.set_position(pos)
if pos.y < 0 then
go.delete()
end
end
end