This tutorial will show you how to have a character crouch, perform a crouched dash-slide, remain crouched even if the ↓ button is released when the character is underneath a crawlspace, and all of this works in reverse gravity too.
Setup Platform Character
We will be using a player container with pinned animations, as is standard with platformer games.
Here is our character positioned over a separate fucia container object:
Now we lay them directly over the top of each other:
Pin the character to the box:
Open full size image
The box has gravity normal and (a redundant) flipped anim, as well as crouch normal and flipped.
Open full size image

Open full size image
The only thing that changes is the collision polygon, the origin stays exactly the same for all states of crouch/gravity (important).
Animations and Preliminary Stuff
Take care of character mirroring:
Open full size image
And some anims:
Open full size image
This ternary operation:
...checks if our player is (in this case not) underneath an obstacle. If our gravity if switched, check ("down" relative to us, but "above" our character's head) down 20px for an overlap, or up -20px if gravity is normal.
Crawling and Crouching
This sets the ducking player animations and our crawling speed:
Open full size image

Open full size image
The last condition checks if we are on ground and restores the walk speed.
This is a test for the state of gravity according to the playerobject's collision box animation:
Open full size image
This sets more animations for the player and restores our walking speed if we're not crouching anymore:
Open full size image
Setting the crouch animations (and keeping us crouched even if we release the ↓ key when underneath an obstacle:
Open full size image
Again, more animations and ways to check we are able to stand if we are not underneath an obstacle:
Open full size image
Slides
Here are our ways of calling the slide function:
Open full size image
And here are the left and right slide functions:
Open full size image
Notice how if the character decelerates to the crawl speed, we keep on crawling at that speed rather than decelerating any further.
Jumping
Here are our jump conditions, but we don't jump if we are underneath an obstacle, rather the slide conditions will take care of that (this is for both states of gravity) and also to keep jumping if space is pressed when we land:
Open full size image
Gravity
Here are our gravity object collision animations and player animation conditions. It also takes care of all of the gravity changes and returns to normal after a predetermined time:
Open full size image
And that's it, have fun!
Unlock your full gamedev potential
Upgrade to the Personal Edition of Construct 2, it has way more features and won't holding back from making money and using your full creativity like the free edition does. It's a one off payment and all Construct 2 editor updates are free for life!
View deals
Plus, it's got a lot of additional features that will help you save time and make more impressive games!