not spawning in or behind the camera zone, please help me.

liamoliamo Member Posts: 191
edited November -1 in Working with GS (Mac)
Hi guys, i'm sorting out my obstacles in my run 'n' jump game and i observed a problem with my pits, they kept spawning in and behind the camera zone, how do I make my pits spawn only infront of the camera zone.
Liamo
P.S, the pits are on a random spawn behavior.

Comments

  • liamoliamo Member Posts: 191
    bump
  • liamoliamo Member Posts: 191
    double bump, please help
  • liamoliamo Member Posts: 191
    Triple bump
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Is this an endless game with the runner in a static position and the background and obstacles moving towards the runner to simulate motion? Or is this a really long scene that eventually ends?

    If it is the first scenario its easy. Just spawn the pits at 480+(pit width / 2) and have them move into the scene with the moving background.

    If it is the second scenario you will need to unlock the spawn actor instance so that you can have access to the camera. Drag the spawn actor into the scene. Double click on it and double click on the giant padlock icon. Then in the spawn behavior you can have access to scene level attributes (such as the camera origin). So then you'll want to spawn your pits at camera.origin.X + 480 + at least half the pit width

    hope this helps
Sign In or Register to comment.