Using physics behavior to simulate bullet behavior

Get help using Construct 2

Post » Fri Jun 28, 2013 2:20 pm

Hi. I previously used the bullet behaviour for my projectiles and they worked great. But, I want my bullets to interact with other physics objects, like the ground. And I can't just add physics to the behaviours because the bullet behaviour overrides the physics one.

So, does anyone know how to use the physics behaviour to simulate the bullet behaviour, like the parabolic path? Or, any other solution?

Any help is appreciated!
B
6
S
1
Posts: 22
Reputation: 459

Post » Fri Jun 28, 2013 2:33 pm

Give the bullet an instance variable like isShooting, set it to true on creation.

+isSoothing = true
+Every Tick
-> Set Bullet Position lerp(distance) //If you need help with the parameters say it and dont forget dt for bad pcs

+On collide Bullet with X
-> Do whatever you want

+Bullet is outside Layout
- Destroy

This are just basics, if you need more we will need more informations.
B
15
S
6
G
6
Posts: 512
Reputation: 5,555

Post » Fri Jun 28, 2013 2:40 pm

It depends on how you want it to interact with the other objects. Pinning a physics object to a bullet will give it the ability to affect physics objects. Also, the catapult example is a type of bullet; just get rid of the catapult mechanism. You'll have to experiment with settings for angle/rotation.blackhornet2013-06-28 14:40:59
ImageImageImage
B
71
S
22
G
249
Posts: 3,763
Reputation: 138,577

Post » Fri Jun 28, 2013 2:48 pm

[QUOTE=Darklinki]
This are just basics, if you need more we will need more informations.[/QUOTE]

I understand all of this, but how do you make the bullet follow a parabolic path?
B
6
S
1
Posts: 22
Reputation: 459

Post » Fri Jun 28, 2013 3:21 pm

With the sine behavior, should I make you an example ?

You can also use blackhornets way.

-Create an Invisible Object with a Bullet behavior.
- Create Object
- Create bullet (The one with the Physics)
- Pin Bullet to the Object
- Fire the Object

This is easier than my way.
B
15
S
6
G
6
Posts: 512
Reputation: 5,555


Return to How do I....?

Who is online

Users browsing this forum: Hassan Hackmi, kainrazial, t redeemed t and 9 guests