Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

camera help

In my game i have a rocket ship moving up. The rocket ship faces obstacles on his way up. When the the rocket ship lifts off, he will follow the camera in the middle of the screen. Is there any way i can have the rocket ship stay farther down the screen so the player will have more time to react to avoid the obstacles?


  • MentalDonkeyGamesMentalDonkeyGames Posts: 1,276Member
    edited August 2016

    There is a few ways to achieve this. Try this one:

    -Create a new actor, call it CameraControl.
    -Create a new game attribute (real). Call it ShipY
    -In the space ship actor, put a constrain attribute game.ShipY to self.position Y.
    -In the CameraControl actor put a constrain attribute self.position Y to game.ShipY+300.
    -Put the "Control camera" behaviour in the CameraControl actor, and remove it from the space ship actor.
    -Drag the CameraControl actor to the scene. Put it at the same position on the X axis as the space ship is.

    This will make the camera follow the CameraControl actor, witch will always be 300 pixels above the space ship.

    NOTE: If your game also scrolls sideways, you also need a ShipX game attribute, and constrain it the same way you did with the ShipY, but only with X axis.

    Hope this helps!

    Mental Donkey Games
    Website - Facebook - Twitter

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

    Unlock your rocket, delete camera control behavior.

    Constrain camera origin Y to self Y - 100

Sign In or Register to comment.