Bullet Killing Enemies In Next Scene

Discussion in 'Gameplay' started by mattdryer, Aug 15, 2017.

  1. mattdryer

    mattdryer Boxer

    Joined:
    Jul 9, 2017
    Messages:
    4
    Likes Received:
    1
    Can someone please tell me how I can prevent my bullet from shooting into the next scene and killing enemies before they appear? Thanks
     
  2. Phill Mason

    Phill Mason Serious Boxer

    Joined:
    Sep 25, 2015
    Messages:
    880
    Likes Received:
    720
    Hi there @mattdryer, you can add a component to your bullet. Select the bullet in your scene and click "Add Component" bottom right of Buildbox and set the "Sleep" distance to a certain number. (see image). This will stop your bullet from constantly travelling. You'll have to play around with the distance number a little until you get it just to the point of out of the current screen.
    Screen Shot 2017-08-15 at 12.43.04.png
     
    mattdryer likes this.
  3. mattdryer

    mattdryer Boxer

    Joined:
    Jul 9, 2017
    Messages:
    4
    Likes Received:
    1
    Alright cool, I wasn't sure if maybe there was another way. Thank you!
     
    Phill Mason likes this.
  4. Phill Mason

    Phill Mason Serious Boxer

    Joined:
    Sep 25, 2015
    Messages:
    880
    Likes Received:
    720
    Hey @mattdryer, I'm sure there are many other ways, that was just the first one that popped into my head :)

    I suppose you could also create a fake invisible enemy that sits on the border of your current scene. I would probably drop in a small square image, I often use something tiny like a 10 x 10px coloured square, so it doesn't take up too much atlas space and then stretch (scale) it to fill the side of your screen where you're trying to stop the bullets from passing. Make it reasonably thin so it doesn't get in the way of any gameplay area and set it's health component really high, to something like 9999, so it can soak up any stray bullets. Once you're happy it's working as you want, set it's transparency to -1 and it'll disappear from the screen but will be working in the background, stopping any bullets from passing into the next scene.

    That's another way to do it, but I'm sure there are many more possibilities.
     
    mattdryer and Benfont like this.
  5. AGoberg

    AGoberg Boxer

    Joined:
    Aug 16, 2017
    Messages:
    7
    Likes Received:
    2
    I just set Back/Sides Deletion Threshold to 1. Not sure if this creates a problem elsewhere?
     

    Attached Files:

    mattdryer likes this.
  6. FunkyFox

    FunkyFox Boxer

    Joined:
    Aug 17, 2018
    Messages:
    12
    Likes Received:
    3
    Old thread, but thought I'd comment in case anyone else was searching this like I was. AGobery has it correct, however if you have objects that spawn off screen, e.g an enemy that starts off screen and comes across, then these will not spawn. So if you set the Back and Sides deletion threshold on your world to 100. These enemies will still spawn, and your bullets won't kill anything that's far away.
     

Share This Page