How do I Enable/Disable collision (Not global to sprite)

Get help using Construct 2

Post » Fri Jul 22, 2016 3:11 am

Message: ginConstruct can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hi all :)
Hopefully someone could help shed some light.

Below is the intended flow:
1) Ball rested on lower platform.
2) Click to toss the ball.
3) Ball land on upper platform.
4) Spawn new ball on lower platform, previous ball(s) remain on the upper platform.

I'm having difficulty with (4).
Tried playing around by toggling collision/physics of both ball and platform, but couldn't get the result I want.
Need help on this.

Also, if you noticed anything that could be done more efficiently or things you would do differently in my project, feel free to comment!
Would love to know how to better use Construct2.

Download @ Dropbox
https://www.dropbox.com/s/r2imm9iiuhy9e2v/ObjectTossPhysics%20-%20forum.capx?dl=0
Last edited by ginConstruct on Fri Jul 22, 2016 5:48 am, edited 1 time in total.
B
9
S
1
G
1
Posts: 5
Reputation: 935

Post » Fri Jul 22, 2016 3:40 am

Have you tried using the behavior "Jump-thru" instead of "Solid" for the green platform?
B
26
S
9
G
2
Posts: 234
Reputation: 3,199

Post » Fri Jul 22, 2016 3:47 am

Message: ginConstruct can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Sorry I forgot to mention clearly that I'm using physics.
I think Jump-thru doesn't work with physics? Or am I missing something.. still new in Construct 2

Edit 1:
Hmm I just saw this on the manual. Looks like it has to be done through the physics behavior?
https://www.scirra.com/manual/98/physics
Another consequence is Physics won't respond to objects with the Solid or Jumpthru behaviors. These behaviors are totally redundant when using Physics and have no effect. Instead, use the Immovable property.
B
9
S
1
G
1
Posts: 5
Reputation: 935

Post » Fri Jul 22, 2016 9:43 am

You are correct about physics not interacting with platformer/solid/jump through behaviors.

In your current code, the issue with the inactive ball is that it is not set to stay in place.
I would modify it so that inactive ball gets the immovable property as well. This way, they are still an obstacle, and give the visual impression to rest on the platform, when the platform is actually loosing its physics consistency to let the lower ball come through.

I added a "Set physics immovable" in the "DIsableBall" function and a "Set physics movable" in the "Ball is Active" (event 4) of the main Event sheet and this seems to do the trick.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
289
S
112
G
94
Posts: 7,333
Reputation: 69,287

Post » Fri Jul 22, 2016 9:45 am

elafreat meant to suggest the platform behavior because you asked for an easy solution, and the platform is.

But if you insist on using physics:
https://drive.google.com/open?id=0B1SSu ... VQzbDIydm8

I did't fill in all those text objects. Thats 4 you to do.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Fri Jul 22, 2016 11:01 am

@Kyatric
Thanks for the suggestion! But I want the balls to remain their physics behavior, where they will still bounce away when hit by other balls.

@99Instances2Go
Yeah I want the physics behavior for the interaction between balls.

Your idea of using a dummy when tossing is great!
Still in the middle of implementing it as I need to change quite a few things.
But I think this is exactly what I needed :)

The text objects were for debug purposes when I did my own projectile simulation..
But soon realized that I want the physics behavior upon collision. So i dropped the whole thing.
You were right to ignore them. haha.
B
9
S
1
G
1
Posts: 5
Reputation: 935


Return to How do I....?

Who is online

Users browsing this forum: Construct Monkey, David181, dop2000, luckyrawatlucky and 5 guests