Keep the camera centered while zooming with contrains

ApprowApprow Member Posts: 703

I made a super awesome mega hyper dynamic camera. It tracks enemies and bullets so it can predict danger, its zooms in and out, moves up down left right based on whats happening on the screen, it tracks the player in various ways, big and heavy screenshakes, and it needs to stay within a certain area, I'm not going too much in depth about this, but its more or less a big mathematical bomb! (I think it's using over 18 contrains)

I run into a problem when the camera zooms out. While it zooms it never stays centered relative to the player (the tracking area). Its not a big zoom so not very noticeable, but I want to do it right. I know the control camera behavior keeps it centered when you set the tracking area to 0, but this behavior is so primitive that it's not usable for this project (I actually never use it anyway). I'm also still not sure why everything in gamesalad is has a centre point thats actually in the centre, except for the camera. I think it is because the scene's can only expand up and right, who know's:)

If someone know's the solution to keep a camera centered while zooming in or out with constrains, please share it here:) Thanks!

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    @Approw said:
    If someone know's the solution to keep a camera centered while zooming in or out with constrains, please share it here:) Thanks!

    Constrain camera origin X to whatever is controlling the camera's X - half the camera's X size
    Constrain camera origin Y to whatever is controlling the camera's Y - half the camera's Y size

  • ApprowApprow Member Posts: 703

    @Socks Thanks, I already tried that before, but didn't work. Now I figured that it was another calculation that was messing with my master piece:D... so thanks again for the clarification:)

    Can a moderator close this thread @BlackCloakGS @dgackey?

This discussion has been closed.