How do I prevent Enemies from being Knockbacked by bullets?

0 favourites
  • 5 posts
From the Asset Store
Pixel Enemies for SHMUP consists of 45 enemy ship sprites to be used in your game.
  • Hello boys and girls, as always I ask for you help because I have not found anything satisfying my question.

    I'm making a game (platform) where my Player throws (spawns) little bones (with bullet behaviours) to attack the enemies.

    The events are set in order to destroy each bone as soon as it collides with an enemy (and obviously subctract 1 from the instance variable created for the enemy HP).

    The problem is that in the moment the bone hits the enemy, the enemy get "stunned" for 0.00001 sec... if I spam bones like hell I can almost STOP an enemy running towards the Player (even if I set a very high speed to it).

    With my first boss, for example, which is much bigger than the player, if I am grounded and spawn bones he starts to make "little jumps" because the bones collide with the base of his polygon collider and he, basically, try to "walk on bones" lol XD.

    Now, I would like that when a bone (bullet) collides with the enemy, the enemy IGNORES the physic collision with it and goes on with what he is doing (running towards the player for example). If I shoot the boss, I don't want he "jumps" on the bullets because he "feels" a solid platform down to him.

    Is it possible?

    If I disable collision the enemies are no longer damaged from my bones... ok, I could set the events with Overlap instead of Collision... but is it the only way?

    Thank you as always for you competence, patience, and understanding :D

  • So the stun is something you've implemented yourself with a wait? Because a bullet doesn't collide in the way you're describing, it would just pass through the enemies.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello and thanks for the reply.

    Well, not properly. An Enemy With Platform Behaviour is not just passed by a bullet, instead, the bullet will push him Back until the end of the layout or until the bullet is destroyed.

    And this is default.

    Make the bullet destroy prevent from “push the enemy back until they reach another planet” lol but at the moment of collision FIRST the bullet hits and push the enemy back and affer this the bullet get destroyed. Is something like, really, 0.001 seconds but if the bullets are shot in a rapid row the enemies just can’t keep Walking or running. You can really slow them down just by firing very very fast.... this would be ok with some standard enemies but no with a Huge boss.

    Everything is default I have not added any wait time.

    Thank you again

  • By default the bullet just moves at an angle. Do you have bounce off solids enabled? You can disable that and then just detect a collision without it pushing the enemies.

  • Ok, I am just stupid... but thanks to your tips I have found the (terribly noobish) mistake.... Bone (bullet) was one of the first object I created and now that I have several layouts and hundreds of events I just.. ehm... didn't notice I have given to Bone the solid behaviour (for some unknow reason, or simply for a missclick).

    So that is. Now it's ok..

    Thank you again mate and sorry for the waste of time :(

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