Best Method for Precise Bullet Collisions?

Get help using Construct 2

Post » Mon Apr 14, 2014 3:25 pm

Hey all,

I was wondering what the best method for implementing precise bullet collisions might be?

What I'm trying to do is have the bullet destroy itself on impact with a wall and turn into a platform at the exact point of impact. Sometimes it works perfectly but others it spawns inside the wall, especially when I fire closer to the wall.

I'm assuming it's to do with the engine not checking for updates quick enough? Every Tick doesn't seem to be cutting it in this case.

Here's my capx file, hopefully I uploaded it correctly: https://dl.dropboxusercontent.com/u/96804667/Test.capx

Thanks for any and all help.
B
6
S
2
G
1
Posts: 10
Reputation: 905

Post » Mon Apr 14, 2014 9:16 pm

I'm not entirely sure what is causing the problem but you can have on collision to set the bullets speed and acceleration to 0 so then you can see were it is landing.

When I used debug mode and slowed the time scale down it hit on the edge perfectly every time. (Unless I was standing right on top of the thing of course.

If you can't figure it out then you could always have the platform be set behind the blocks so that if it over lapped you wouldn't see it anyway.
B
8
S
1
Posts: 76
Reputation: 949

Post » Mon Apr 14, 2014 9:39 pm

One idea is you could put a sub event after your event 3 along the lines of

while
icicle is overlapping block -- move icicle 1 pixel at angle 180

It would need some more thought if you can fire left as well as right...

edit - another thought is just after you create the icicle move it in the z to behind block (this is a bit of a cheat but should look ok)
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
33
G
47
Posts: 1,194
Reputation: 30,832

Post » Sat Apr 26, 2014 6:48 pm

RamPackWobble wrote:One idea is you could put a sub event after your event 3 along the lines of

while
icicle is overlapping block -- move icicle 1 pixel at angle 180

It would need some more thought if you can fire left as well as right...

edit - another thought is just after you create the icicle move it in the z to behind block (this is a bit of a cheat but should look ok)

The "While" sub event seems to have fixed it, wasn't sure how Loops and such worked so this knowledge might come in handy for future problems as well.

Sorry for the late reply, the help was much appreciated!
B
6
S
2
G
1
Posts: 10
Reputation: 905


Return to How do I....?

Who is online

Users browsing this forum: David181, jorgmaquoi, unicornspitfire and 19 guests