Bullet Destroyed Before Hitting Target

Get help using Construct 2

Post » Wed Oct 02, 2013 8:43 am

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.
B
4
Posts: 10
Reputation: 220

Post » Wed Oct 02, 2013 8:51 am

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.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Oct 02, 2013 9:09 am

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.
B
4
Posts: 10
Reputation: 220

Post » Wed Oct 02, 2013 9:19 am

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.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Oct 02, 2013 9:37 am

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?
B
4
Posts: 10
Reputation: 220

Post » Wed Oct 02, 2013 9:59 am

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.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Oct 02, 2013 10:08 am

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.
B
4
Posts: 10
Reputation: 220

Post » Wed Oct 02, 2013 10:11 am

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.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Oct 02, 2013 11:14 am

@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!
B
4
Posts: 10
Reputation: 220


Return to How do I....?

Who is online

Users browsing this forum: amazingdream and 24 guests