Need new system trigger: On collision Ended

Discussion and feedback on Construct 2

Post » Fri Feb 20, 2015 9:24 pm

Hey everyone,

The title says it all. It is easy enough to create a workaround to not having this trigger, but it would be faster and more suitable to have it included in construct. As it is, the work around will not work for physics objects without creating an extra sensor object.
Image
B
32
S
11
G
2
Posts: 563
Reputation: 5,096

Post » Fri Feb 20, 2015 9:28 pm

State variable should do just fine

X Is on collision
varState = Colided
Trigger once - Stuff + set varState to whatever
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
76
S
20
G
19
Posts: 1,931
Reputation: 17,159

Post » Fri Feb 20, 2015 9:54 pm

@megatonx - Either I don't understand what you mean or we are on separate problems. This is how I essentially create an end state for collisions:

OnCollision
------------- this.collided = true

NotIsOverlapping
------------- if (this.collided = true) then this.EndCollision = true

If EndCollision & triggerOnce
------------- // Do Stuff
------------- // this.EndCollision = false

As far as I can tell you need two state tracking variables and the use of IsOverlapping. But as I stated in the OP IsOverlapping doesn't work with physics enabled objects (a separate problem needing addressing). Meaning the workaround now requires sensor objects. potentially doubling the amount of active objects in a scene. Seeing as construct lacks scaleability in the compound object department, I can't see as adding another object to the list as being very desirable.

Essentially, I said workaround exists but problem with workaround exists... which is why the workaround is not a suitable sub for the existence of a new trigger.
Image
B
32
S
11
G
2
Posts: 563
Reputation: 5,096

Post » Fri Feb 20, 2015 10:32 pm

I would stay away from negated is overlapping.
Else should work fine with the trigger conditional this.collided when its true.
Image ImageImage
B
164
S
49
G
137
Posts: 7,945
Reputation: 91,356

Post » Sat Feb 21, 2015 12:19 am

@newt - you can't use else after a trigger
Image
B
32
S
11
G
2
Posts: 563
Reputation: 5,096

Post » Sat Feb 21, 2015 12:26 am

On collision, set variable collided=1

variable collided=1
->object is overlapping other object, do foo
->else set collided to 0
Image ImageImage
B
164
S
49
G
137
Posts: 7,945
Reputation: 91,356

Post » Sat Feb 21, 2015 1:02 am

@newt - a better implemented work around to be sure but still using overlap... which is part of the problem. It won't work with physics.
Image
B
32
S
11
G
2
Posts: 563
Reputation: 5,096


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 7 guests