Keeping actor at the back of screen
LogoLogic
Member Posts: 51
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
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.
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]