Camera locked rotation(SOLVED)

hello! I do not understand how lock camera rotation with rotating object. i saw how it was done in britzl example Rotate, move and fire. Can help with this?

--rotation script
    local to = go.get_world_position()
	local from = vmath.vector3(action.x, action.y, 0)
	local angle = math.atan2(to.x - from.x, from.y - to.y)
	local quat = vmath.quat_rotation_z(angle)
	go.set_rotation(quat) 

In Britzl’s “rotate and move” example, the camera is on its own, separate, game object, so it doesn’t rotate with the player. Its position is set relative to the player’s position every frame.

1 Like

yeap, now it work! Thanks!