Instant hit - exceed range?

This forum is currently in read-only mode.
From the Asset Store
12 unique hits, slashes and spells in transparent PNG sequences
  • I've been working a bit with the Instant Hit option in Construct, and I've run into a problem. I want the bullet to create an object when it exceeds its range, and then disappear. However, instead it creates the object in the spot where the bullet was created - in other words, the bullet doesn't move at all.

    Here's my cap file so you can see exactly what the problem is.

    Mediafire upload

    WASD to move, left click to fire.

  • Tragic and sad - from what I can tell, the bullet behavior places the object back at it's starting point after looping through every step.

    Instead of using the range exceeded action, check instead the traveled distance using Fbullet[Bullet].Travelled compared to your maximum desired range. I gave that a go and everything worked as you'd expect, so it's at the very least a simple workaround.

    I hope this helps. :)

  • Thanks it helped a lot :)

  • Ok I have another problem now, I may as well post it in this thread as it's related to the cap.

    I now want the bullets to create an object and then disappear when they hit the walls. I've created an event which checks On Step and If Bullet is overlapping Wallblock (which is the collision detection block for the walls). However, the bullet just goes straight through. I've tried On collision with Wallblock aswell, to no avail.

  • Looks like it's related to the collision type on your bullet - I set it from per-pixel to bounding box and it worked as you would expect.

    On a related note, you'll need to rethink how your wall collision boxes are setup. As it is now, if you shoot diagonally at a wall between the collision boxes, there's a chance that the bullet will skip right through. I'd suggest either filling these diagonal spots with another collision box to keep shots from coming through, or -- and this is probably preferable -- replace your boxes with isometric ones so you have unbroken surfaces all along the walls.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ah great, that works.

    Yeah I understand what you mean about the wall collision boxes. I've made them diagonal now, with no gaps :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)