How do I disable player control for X period

Get help using Construct 2

Post » Thu Dec 04, 2014 5:58 pm

Long story short, I'm working on an ice stage for my game. I want my player to "freeze" when it hits objects in the layout. My player uses bullet behavior to go where touched (making this game for mobile). However, when the player is frozen, I want the player to not respond to controls for a few seconds.

This seems like something simple but haven't got it working so far... :?

Things I've tried:

Players bullet behavior disabled on contact = nothing happened
Moving player controls into their own group and disabling the group for X seconds = nothing happened

Help much appreciated ~
"If you don't build your dream, someone else will hire you to build theirs"
B
12
S
3
G
1
Posts: 58
Reputation: 915

Post » Thu Dec 04, 2014 6:10 pm

maybe this will work...

system..set Player time scale to 0
system.. wait a few seconds
system..set Player time scale to 1
B
66
S
24
G
7
Posts: 1,514
Reputation: 11,039

Post » Thu Dec 04, 2014 6:52 pm

Easy way i do stuff like that is have all player controls in a group, then disable the group when a player cant have control. and then activate that group again when the player should be able to have control again.
B
4
Posts: 12
Reputation: 224

Post » Thu Dec 04, 2014 8:05 pm

Thanks guys!

Both ways work now, of which I like the group better since it doesn't disable bullet behavior.

However, it won't work if I try to have these events only for the ice stage. In my current setup I have stage1 events included in other stages and apparently I can't affect "Included layout" with events made on another layout.

I guess I just gotta have nonchanging events on a general layout and every changing event separately for each stage?

EDIT:

Disabling group stopped working again, even when the group is in the same layout. Not sure why.
"If you don't build your dream, someone else will hire you to build theirs"
B
12
S
3
G
1
Posts: 58
Reputation: 915


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 34 guests