3rd Person Camera

  1. last year

    I'm new to Polycode and have been working with the example file "3DPhysics_Character." Currently I'm having trouble getting a working 3rd person camera. What I've done so far is added some code at the end of Main.lua through a fixedUpdate function that has been recommended in other posts about camera manipulation.

    function fixedUpdate(elapsed)
    scene:getDefaultCamera():lookAt(Vector3(0,0,0), Vector3(0,1,0))

    Any help? Thanks!

  2. Hi Mage,

    You will want to position the player and camera in relation to one another first, then add the camera as a child entity to the character entity. It is deceptively simple. Once done, this will make the camera follow the transformations (translation, rotation) of the character. Your update code shown above should be unnecessary.


    Good luck.


or Sign Up to reply!