View Single Post
Thread: camera hook
camera hook
I saw some in the 3.1 thread that wondered about the camera hook API.

It can override the lookat, pos and FOV of the camera.

Currently there is a bug that prevents over riding on WASD movement.

local function camera()
        -- lookat needs to be called before pos 
        set_camera_lookat(0, 2, 1.5)
        set_camera_pos(3, 2, 1.1)
        set_fov(120)

        -- return 1 to disable the clients camera functions
        -- NOTE WASD and arrows are not possible to disable today 
        return 1
end

add_hook("camera", "fovcam", camera)