Keeping actor at the back of screen

LogoLogicLogoLogic Member Posts: 51
edited November -1 in Working with GS (Mac)
I am trying to keep my main actor at the back of the screen as it scrolls. As of now I have fixed the camera in the middle of the screen but I do not know how to make my actor stay to the back as it scrolls. Hope this makes sense. Thanks.

Comments

  • chosenonestudioschosenonestudios Member Posts: 1,714
    Under game, you can find your actor, and you can drag it down to the bottom
  • LogoLogicLogoLogic Member Posts: 51
    I start the preview at the back of the screen and go forward to the middle and then the screen starts scrolling. I want the screen to start scrolling as soon as I start moving from the very edge of the screen. I tried to move my actor to different start positions but it always moves in the middle. The camera is constrained to its smallest size. I am not sure what you mean choseonestudios.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Right now you cannot have the camera tracking area be offset. It is always in the middle.

    You could try having an invisible actor that is constrained to player to be a certain distance away.
    And have that actor control the camera.

    It will most likely cause a little jerkiness though.
  • HachikoHachiko Member Posts: 330
    you can constrain the camera origin itself, through an istance of the actor.
  • LogoLogicLogoLogic Member Posts: 51
    How would I do that Hachiko? I only see camera origin under scene attributes. I will try the invisible firemaplegames. Thanks.
  • LogoLogicLogoLogic Member Posts: 51
    LogoLogic said:
    How would I do that Hachiko? I only see camera origin under scene attributes. I will try the invisible actor, firemaplegames. Thanks.

  • firemaplegamesfiremaplegames Member Posts: 3,211
    To access the Camera, you need to have an unlocked Instance. Instances in the Scene have full access to the Scene Attributes, including all the other Instances in the Scene.

    To make a Camera Controller, do this:

    Create a new integer game Attribute called PlayerX.

    In your Player Actor prototype, add a Constrain Attribute
    Constrain game.PlayerX To: self.Position.X

    Now make a new Actor called CameraController. A simple box will do. Do not put any code in this Actor. Drag an Instance of it into the Scene, just out out of view.

    Double-click on the Instance to open its properties.

    Set Movable to false.

    Now click on the padlock on the right to access its behaviors.

    Add a Constrain Attribute behavior.

    Constrain Attribute: Current Scene/Camera/Origin/X To: game.PlayerX + [whatever]
Sign In or Register to comment.