Bullet Destroyed Before Hitting Target

0 favourites
  • 9 posts
From the Asset Store
This pack contains 10 types of bullet effects, with different shapes and colors.
  • Hi, i'm new and don't know where to ask this. But i really need help.

    Ok i just straight to the point.

    I have two objects, when i click the mouse object #1 then spawning(shooting) bullet object to object #2 and it will destroy when it hit it. but my problem is, because i decreased the bullet speed, when the object #1 shooting bullets, and i keep clicking,then more bullets on screen, the first bullet destroyed nicely when hit,but the next bullets following the first one also destroyed before they reach the target.

    Hope any of you understand w/ i'm saying. :D i'd appreciate any help.

  • You have a picking issue.

    Your event doesn't tell C2 which instance of the bullet to destroy so it destroys all bullets.

    Could be the bullet making the collision isn't referenced in your event, but couldn't say for sure without seeing it.

  • Thanks for your reply.

    Yes, this "instance" you are saying is part i dont really understand yet. i created only one kind of bullet, so the bullets that object#1 will keep spawning are is the same bullet. so is any with that "uid" or "id" or something, how to do thi, i'm really new to this,

    (i want to give you hyperlink i see on other page but dont know how to create one)XD.hope you can help me.

  • It's the same sprite, but a different instance of the sprite.

    Usually C2 is pretty good at referencing only the instance intended if the instance is mentioned in the top event.

    It's also possible to work with uid's (I don't do that as much as I probably should) and send the sprite uid to a function which handles all events relating to the collision.

  • Ok thanks. but now i don't really about your explaining. can you create a simple one so i can fully understand what you mean. XD i'll just describe it ok. i have two ships side by side firing cannon each other, when i click and rapidly clicking 5 times, then it's spawning bullet 1,2,3,4,5. five bullets now on screen slowly towards the target,when the first bullet(bullet no.1) colliding with target,it destroyed, BUT, the bullet 2,3,4,5 destroyed at that time too. so the explosions of them will be looked like a laser beam on screen XD. so? how to do this right?

  • Could you post your capx?

    I don't know how you have your events set up, so even when I give an example the issue could be coming from a different place.

    Are you spawning the explosions?

    Are you destroying the bullet and set it's animation after that?

    It's probably just a simple problem in the order of the events or in the instance-picking, but I need to see your code if I want to change it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • where to post it?? just don't know,can you tell me?

    i just cracked a problem, i hope it's the cause of all this XD i'm gonna check it first.

  • Easiest way to post it is to make a dropbox-account and upload it there.

    Then provide the link to the capx in a post on this forum.

  • LittleStain : I was pinning an object to my bullet object, and having trouble when destroying them altogether, that's my mistake.(i'm sorry if you can't understand what i'm talking about)XD all is fixed. I'm still learning this and for my further problem i'll be asking for your help. I really appreciated your help,ok. thanks!

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