Constraining Actor and Scrolling Camera
TouchTiltGames
Member Posts: 1,162
Ok so here's what I'm trying to do, like always, I almost get there but get stuck on one last thing :0
I've got an actor in a platformer setting constantly moving right and is constrained on the X at say 200px. I always want the actor to stay in the same position while its moving instead of ending up hitting the right side of the screen, about the first 1/4 of the screen. So I've got all that setup, but the screen/camera isn't scrolling obviously because the actor is constrained.
I tried an invisible camera tracker to follow that is constrained to the moving actor but that doesn't work because it's constrained to the hero .
So what's the easiest way to keep the actor in the same spot yet have the camera scroll so you can scroll past other scrollable objects ?
cheers,
shane
I've got an actor in a platformer setting constantly moving right and is constrained on the X at say 200px. I always want the actor to stay in the same position while its moving instead of ending up hitting the right side of the screen, about the first 1/4 of the screen. So I've got all that setup, but the screen/camera isn't scrolling obviously because the actor is constrained.
I tried an invisible camera tracker to follow that is constrained to the moving actor but that doesn't work because it's constrained to the hero .
So what's the easiest way to keep the actor in the same spot yet have the camera scroll so you can scroll past other scrollable objects ?
cheers,
shane
Comments
1)Try scrolling the background instead.
2) Or limit the ability of your scrolling actor by putting in a rule that stops moving right when it hits the end of the scene.
Rule: If self.Position.X < (scenesize)-280
-- Move: 0 degrees
So when it gets to that limit it no longer moves right.
The scrolling objects are on a scrollable layer.
When you say (scenesize) are you referring to 'game.Screen.Size.Width' or are you just referring to the "scene size" with -280?
@TSB - Yeah I tried Orbz demo but his setup is a lot different than mine but I understand what he's doing there..