On Collision With Object - Why Not Part Of Function?[UPDATE]

Just started using Construct 2? Post your questions here

Post » Mon Aug 22, 2016 6:44 am

Sprite - On Collision With Another Object - Destroy, etc.

Why can't this be part of a function?

There's no way to drag it in, Construct 2 won't allow it, so I'm guessing it's programmed this way.

Why?

It would make programming some things a lot easier.

What's so special about this that it has this exception?

I was able to do a workaround for what I needed, actually learned some cool new things by doing things in reverse vs. what I knew in this weird sequence (since this has to be outside a function), but if this was possible it would enable more complex functions and save a few lines of code here and there.

From reading somewhere, I remember the green arrow means it's executed only once?

How do you change it to once per tick?

And again, why was this programmed this way?

You could argue it's already its own function since it executes once by default, but I just don't understand why it's singled out with this exception and complicates programming a bit.
Last edited by AmpedRobot on Thu Aug 25, 2016 4:40 am, edited 2 times in total.
B
37
S
20
G
18
Posts: 259
Reputation: 12,922

Post » Mon Aug 22, 2016 7:08 am

The green arrow means it's a trigger most of the time. "On collision" is actually equivalent to "is overlapping" and "trigger once". If you want to check for a collision in a function just use the "is overlapping" condition.
B
92
S
32
G
109
Posts: 5,291
Reputation: 70,993

Post » Mon Aug 22, 2016 7:34 am

Ah, thank you.

Had no idea.

P.S. Love your portal code! :P

On Collision With; however is executed once per the green arrow.

Overlapping With is once per tick, which is I suppose why the 2 exist.

It would still be useful the have the one that executes once as part of a function, unless you can toggle the green arrow?

I seem to have read somewhere that you can?

Oh, well no matter.
B
37
S
20
G
18
Posts: 259
Reputation: 12,922


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests