Turn off Bounce off Solids via Event

Get help using Construct 2

Post » Wed Jun 06, 2012 11:13 pm

Hello,

I'm trying to turn off the "Bounce off Solids" parameter via an event. It's like it's missing that option. I can set everything else, like gravity, and speed, but not this option.

Or maybe i'm missing it somewhere.

Can you help?
Epic Space Online - Google it!
B
34
S
10
G
5
Posts: 165
Reputation: 6,637

Post » Thu Jun 07, 2012 1:13 am

You could try disabling the solid behavior on the solid objects.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,518

Post » Thu Jun 07, 2012 1:27 am

You can also create two bullet behaviors on your sprite -- one with bounce enabled and one disabled as in the following capx.

DoubleBullet.capx

Left click to disable bounce, right click to enable. Try to reach the key.
B
29
S
11
G
12
Posts: 281
Reputation: 11,868

Post » Thu Jun 07, 2012 1:39 am

[QUOTE=Ashley] You could try disabling the solid behavior on the solid objects.[/QUOTE]

The object originally didn't have the "solid" behavior, it had the bullet behavior.

So I added the solid behavior and at the right time fired off the action "Set Solid Disabled"

But no luck, it still runs into solids.

It's the bullet behavior and it's "Bounce off Solids" parameter.

How do I turn that one off?
Epic Space Online - Google it!
B
34
S
10
G
5
Posts: 165
Reputation: 6,637

Post » Thu Jun 07, 2012 1:41 am

[QUOTE=kittiewan] You can also create two bullet behaviors on your sprite -- one with bounce enabled and one disabled as in the following capx.

DoubleBullet.capx

Left click to disable bounce, right click to enable. Try to reach the key.[/QUOTE]

The problem, is that I use the bullet behavior to move the object. It's a plane, so I want it to "Fly" over solid objects essentially.

Epic Space Online - Google it!
B
34
S
10
G
5
Posts: 165
Reputation: 6,637

Post » Thu Jun 07, 2012 2:52 am

Just click where it says "Yes", in the "Bounce off Solids" parameter and select "No".
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Thu Jun 07, 2012 3:01 am

Ashley was not suggesting adding solid behavior to your airplane sprite, but that you turn it off on the wall that the plane is colliding with if you don't want it to bounce at that time.

In my example the ball goes through the walls when you left click (which turns off bounce off walls) only because the ball was placed in the layout before the walls. If you want it to go over the walls, just move the walls to the bottom of the z order. (Or you could put the ball on a layer above the wall layer.)

I updated the project so that it has the walls at the bottom. The ball flies right over the walls when you left click, and bounces off the walls when you right click.

Note that any changes you make to one bullet behavior you should make to the other bullet behavior. That is why I copied the angle of motion from one to the other when switching behaviors. That would also apply to speed.kittiewan2012-06-07 03:03:51
B
29
S
11
G
12
Posts: 281
Reputation: 11,868

Post » Thu Jun 07, 2012 3:35 am

[QUOTE=Nimtrix] Just click where it says "Yes", in the "Bounce off Solids" parameter and select "No".[/QUOTE]

How do you do this as an action?
Epic Space Online - Google it!
B
34
S
10
G
5
Posts: 165
Reputation: 6,637

Post » Thu Jun 07, 2012 3:37 am

[QUOTE=kittiewan] Ashley was not suggesting adding solid behavior to your airplane sprite, but that you turn it off on the wall that the plane is colliding with if you don't want it to bounce at that time.

In my example the ball goes through the walls when you left click (which turns off bounce off walls) only because the ball was placed in the layout before the walls. If you want it to go over the walls, just move the walls to the bottom of the z order. (Or you could put the ball on a layer above the wall layer.)

I updated the project so that it has the walls at the bottom. The ball flies right over the walls when you left click, and bounces off the walls when you right click.

Note that any changes you make to one bullet behavior you should make to the other bullet behavior. That is why I copied the angle of motion from one to the other when switching behaviors. That would also apply to speed.[/QUOTE]

Both objects aren't bullets, and we can't allow other objects but the plane pass so this wouldn't work.

The easiest solution is to adjust that parameter for the bullet behavior on the plane using the event sheet. You can adjust others, but not this one parameter unless I'm just missing it...Taurian2012-06-07 03:59:42
Epic Space Online - Google it!
B
34
S
10
G
5
Posts: 165
Reputation: 6,637

Post » Fri Jun 08, 2012 9:46 pm

I don't think you are reading what I am saying or looking at the example I took the time to provide. In the example there is only one sprite with the bullet behavior. Let me repeat: There is only ONE(1) SPRITE with the bullet behavior!

However, that single sprite object has TWO (2) bullet behaviors on it. I know it isn't as easy as the solution you WANT, but that doesn't exist. And even though this one sounds weird, it DOES work, and does not allow other objects to pass through the walls even temporarily.

Here. Let me draw you a picture:



This is a perfect example of why you should post YOUR example so we can help you with YOUR specific case, rather than have to try to guess what you want and have you tell us we didn't guess right.

EDIT: Sorry if I came off as a bit ticked. I don't mean to. If you still have questions, post a simple capx showing what you are trying to do. It will save everyone a lot of time.
kittiewan2012-06-08 22:17:12
B
29
S
11
G
12
Posts: 281
Reputation: 11,868

Next

Return to How do I....?

Who is online

Users browsing this forum: Pandadoor, Zebbi and 18 guests