Prevent bullets from going off screen

Is there a way to test whether or not an actor is off screen with a scrolling camera?

I don't want the players bullets to go off screen and kill things he hasn't seen.

Comments

  • SingleSparqSingleSparq Member Posts: 1,339

    Put an invisible stationary actor around the border areas of your game. If bullet hits it, destroy bullet.

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989

    Or do some maths with an offset for the cameras position.

    If the bullets x or y is greater or less than the screen width/height plus the cameras origin (accessible from an unlocked actor). Destroy bullet or move it off the side of screen till its required in another shot (recyling actors rather than spawning)

  • Thunder_ChildThunder_Child Member Posts: 2,343
  • ookami007ookami007 Member Posts: 581

    I tried putting a bullet destroying wall on the HUD (non scrollable) but it seems like the EFFECT "scrolls" rather than staying on the ends of the screen with the rest of the HUD... even though visibily it's there on the ends of the screen... WEIRD...

    Any ideas?

Sign In or Register to comment.