How do I prevent shooting through solids?

Get help using Construct 2

Post » Mon Jun 09, 2014 6:33 am

I have a lot of solid sprites and my bullet is supposed to bounce of them. They are around the bullet too. But sometimes the bullet just jumps through them. I guess that is just too much velocity and the collision check comes in too late? Anyways how would I prevent it? Reduce speed? Thicken the solids?
B
40
S
11
G
4
Posts: 665
Reputation: 8,453

Post » Mon Jun 09, 2014 12:43 pm

hey Shoening..you may need to show an example capx...
collision detection is based on the Collision mesh ..if its too small then yeah the bullet may pass through undetected..

your ideas are good for trying to prevent this ...
but it comes down to specific solids and the meshes ..would need to see a demo or capx to really break it down and see what is happening..
you could try using delta time scale and slow it right down to see if there is another problem ..
like on start of layout set time scale to 0.2 or something..this might help you see whats going on...it may not either but it could point to your bullets being too fast..to activate the collision events on certain meshes
When in doubt..or you are lost in a Zombie apocalypse or someone is giving you a hard time..Remember one thing..... Read the Construct 2 Manual..it will save your life.:)
B
35
S
13
G
8
Posts: 318
Reputation: 7,685

Post » Mon Jun 09, 2014 8:58 pm

- Create a family for all solid sprites
- For a moving bullet you can check "is overlapping at offset" to pre-determine whether it is going to hit the wall.
- If so, bounce it.

Good Luck and hope my suggestions help.

Cheers
B
8
S
3
Posts: 9
Reputation: 917

Post » Tue Jun 10, 2014 9:16 am

@studioamk I never used "offset" before. Thank you. Could you tell me what the differences between overlapping an offset and overlapping an object are? I mean there is only one bounding box right?
B
40
S
11
G
4
Posts: 665
Reputation: 8,453


Return to How do I....?

Who is online

Users browsing this forum: Lordshiva1948 and 8 guests