How can the camera follow the player?

  • #1, by AvenThursday, 21. December 2017, 03:20 7 years ago
    Hey guys,

    can you tell me how I can setup that the camera follows the hero from beginning? At the moment it is: if I reach the edge of the visible area, the camera starts moving. But I want the character centered, so:

    1. How can I do this globally?
    2. Is it possible to change sometimes (like in cutscenes)?

    Thanks!

    Newbie

    23 Posts


  • #2, by afrlmeThursday, 21. December 2017, 03:52 7 years ago
    How to always center camera on active character...
    game.HorizontalScrollDistance = (game.WindowResolution.x / 2)
    game.VerticalScrollDistance = (game.WindowResolution.y / 2)

    Add that inside of an execute a script action part.

    You can reset it back to the default value by doing  the same thing, but setting the values back to 5...
    game.HorizontalScrollDistance = 5
    game.VerticalScrollDistance = 5

    Imperator

    7285 Posts

  • #3, by AvenThursday, 21. December 2017, 11:11 7 years ago
    Hi AFRLme,

    you are a genius, big thank you!

    Alex

    Newbie

    23 Posts