Actor Controlling Camera Question.
CaptFinn
Member Posts: 1,828
Scene Size = 3480x800
Actor moves from left to right.
Actor controls camera.
The larger the camera is from left to right the longer it takes for the actor to start moving the camera.
The smallest the camera can be... the actor starts moving the camera once it travel to mid screen.
I need the actor to start moving the camera way before it gets to the center of the screen.
Comments
Dump the Control Camera behaviour.
Constrain camera origin X to self.X - (some value)
So with an iPad landscape project if you want the actor to sit a quarter of the way across the screen (L>R) it would be . . .
Constrain camera origin X to self.X - 256
Or
Constrain camera origin X to self.X - (camera width / 4)
. . . . . . . . . . . . . .
Camera Orgin X and Y are the bottom lefthand corner coordinates of the camera area, you can position the origin wherever you like, if you were to constrain the X and Y Origin to your actor, then your actor would always be in the bottom lefthand corner, if you use the Camera Control behaviour and close the tracking area right up as small as it will go then the 'constrain camera origin’ equivalent would be:
Constrain camera origin X to self.x - camera width / 2
Constrain camera origin Y to self.y - camera height / 2
Etc etc
So shrink camera as small as possible and just constrain it to actors x how ever much I need. I think I gotcha.
Not sure what 'shrink [the] camera' would mean in this context, shrinking the camera tracking area only applies to using the Control Camera behaviour and shrinking the actual camera would just zoom in on your scene . . . what I am saying is to not use the Camera Control behaviour at all and just constrain the camera's origin to the actor's position with an offset.
does this mean I have to unlock the actor to be able to access camera origin?
Unlocked it. As its falling down the pit. It looks good. But when it lands. There is way to much off screen visible.
You have a email I can send you this to. So you can see what I did.
Cryptic stuff
Move the bottom of the pit higher up so the 'off screen stuff' doesn't show. The camera has a set view box it will always show, if you don't want the off screen stuff to show you have to create the level/scene so it doesn't.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page