Ledge hanging and Falling help

0 favourites
  • 8 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hi guys!

    So I'm having a small problem with the ledge hanging/falling.

    What I would like to accomplish is to have the player to hang on the ledge for x seconds as long as shift key is pressed but even if the key still pressed, the character falls.

    I tried doing it with the variable I'm using for LedgeGrabbing.

    It was something like: PlayerHelper is Grabbing ---- Wait X Seconds Then set isGrabbing to False.

    But with no results.

    Also tried setting the ledgehelper collision to false and then once its falling again set it back to true. But again no luck.

    Thanks in advance for checking the file out. !

    Cheers!

    here is the capx file.

    https://www.dropbox.com/s/dzhuzf07xi617qj/test_01.capx

    Controls are:

    left and right keys for movement

    up key for jumping

    up plus left or right key for wall jump

    wall glide pressing left or right facing the wall

    shift key for ledge grab

  • still looking at your capx..nice job !!:)

    but i would first try changing the 1st Event in the Group"Grab Ledge/Hang/Climb"

    "Shift is down (inversed)" event to

    "Shift is released--> "

    this event triggers differently to what you have

    see what that does...

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks mystazsea !

    Still, I'm not able to fall off the ledge after x amount of time.

    I tried adding in the Catch a Ledge section a System Wait after Set Grabbing to True and then turn this variable to false but with no results.

    The only way that seemed to work so far was to turn off the collision of the ledgehelper and then back on. but once I turn it back, I cant grab ledges anymore.

    Cheers!

  • Shameless bumpy bump!

    I really need someone to point me out the right directions because Im completely lost here. Technically it should work the same way as I did the wall glide but is not working. Ive been trying every single method I could think off but no luck.

    Thanks in advance!

  • Finally, I got it!

    Actually the idea came after helping someone else!

    What I did was to destroy the ledgehelper after x seconds of grabbing the ledge and after the Player starts falling, re spawn it after x seconds in order to avoid colliding with the ledge again. If a fall is too short, I re-spawn the ledgehelper on the floor as well.

    I don't know if this is the way of doing it but so far it works fine. If anyone got any other ideas please let me know.

    Thanks!!

  • Nevermind, is not a great solution since during debug I see an exponential increase in the number of ledgehelpers created.

    So I still need help

  • Fraktal Zero, its much easier than that.

    ive made a copy of your event for grabbing and disabled yours so you can see whats different

    --> added a "Trigger Once while true" to the Shift grab Keypress

    This makes sure that its not a loop kept active by keeping Shift down

    then

    -->added a Timer to the Player detect "GrabTimer" every time the player does actually grab a ledge

    its set to 4 seconds ..you can change this if you like

    on the "Grabtimer" expring the Ledge Grabb Boolean is made false dropping the player

    but can reactivate on each new shift press

    Hope that helps

    [attachment=0:2yv8qby6][/attachment:2yv8qby6]

  • Ha! Big thanks mystazsea!! That works perfectly!

    Never thought of adding a Timer. Actually I didn't even remember that Behaviour. Also I learned more than a few new things

    thanks to you.

    Thanks again!

    Cheers

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)