Make bullet bounce off some objects not others

Get help using Construct 2

Post » Sat Oct 05, 2013 5:39 pm

I have a bullet I want to bounce off some solid objects but pass through others. For those objects where I don't want the bullet to bounce, I have tried disabling the solid (and collisions) on collision. But the bullet still bounces off the object once if I have the "bounce off solids" option set to yes.

I have also tried adding two bullet behaviors (on my bullet) using the method described in the post linked below (one with bounce, one without), and switching between the behaviors at the time of collision but I still find that the bullet bounces (once) off the objects I want the bullet to pass through.

http://www.scirra.com/forum/turn-off-bounce-off-solids-via-Event_topic53021_page1.html
B
5
S
1
Posts: 44
Reputation: 665

Post » Sat Oct 05, 2013 10:18 pm

Set up an invisible sprite around the object you don't want it to bounce off. When the bullet collides with the invisible sprite, disable collision on the solid as you were doing. That should work.
B
45
S
15
G
73
Posts: 2,006
Reputation: 43,394

Post » Sat Oct 05, 2013 10:27 pm

Disable bounce off solids and use the bullets bounce action when it collides with the objects that you do want it to interact with.
B
46
S
14
G
7
Posts: 603
Reputation: 8,096

Post » Sat Oct 05, 2013 10:30 pm

@EncryptedCow

I don't think you can disable bounce off solids? You can disable the general bullet behaviour but this doesn't work as the object has already collided.
B
45
S
15
G
73
Posts: 2,006
Reputation: 43,394

Post » Sat Oct 05, 2013 10:40 pm

@plinkie It's in the behaviors properties, you can't change it during runtime.EncryptedCow2013-10-05 22:42:58
B
46
S
14
G
7
Posts: 603
Reputation: 8,096

Post » Sat Oct 05, 2013 10:55 pm

Ah I see what you're saying now. Don't use the bounce off solids method. Fair enough : P
B
45
S
15
G
73
Posts: 2,006
Reputation: 43,394

Post » Sun Oct 06, 2013 11:48 am

Thanks, both suggestions work but will go with EncryptedCow's approach as it's easier to implement.
B
5
S
1
Posts: 44
Reputation: 665


Return to How do I....?

Who is online

Users browsing this forum: ivanski1983 and 4 guests