Ladder Animations NightMare!

0 favourites
  • 6 posts
From the Asset Store
3 pixel charaters with over 8 animations each + animations with a gun
  • Hey fellow C2 Guru's I am in need of your assistance. I have a bit of ladder logic that works based on gravity, which allows the player to climb up with overlapping and object and when they are not to reset the gravity back to default. I have attached a screenshot of my entire ladder code.

    The problem I am having is when the player is overlapping the object I set a boolean on the player "onLadder" to true (the default is false) and then to play "Climb" animation. Now when the player is ON the ladder it plays the animations perfectly as long as I do NOT move :( As soon as I move it defaults back to frame 1 of the climb animation and he just appears to slid up or down.

    What I need is to have the player on the ladder and if he is not climbing then pause the animation on that frame and if he moves again to continue playing from that frame..... I have been fighting with this for ages and it is doing my head in. So any and all help would be fantastic and I would be greatful for you ending my ladder torment lol.

    Thanks in advance!

    [Old Image Removed]

  • First, I think you made stuff a bit complicated.

    You don't really need to change gravity, just to control vector Y

    If you want your character to not fall always set vector Y to 0 and for moving up and down it looks like you found out (:

    Anyway, the thing I don't quite understand is why you spawing the Ladder1 object. What is it for ?

    Second, if you give me a stripped version of your capx, just with your character some animation, a ground and a ladder object, I can more easily tweak things to show you.

    That's all (:

  • Ok I simplified it quite a bit as the old way was just not working correctly, however I am still having issues getting the climb animation to fire.

    Here is the new system:

    <img src="http://www.gearworxprod.com/media/new_ladder.jpg" border="0" />

    I am trying to get an animation called "Climb" to fire and play when moving up or down the ladder and pause when not moving, but no matter what I do, I can not get this to work correctly.

    Also As the system is right now when I let go of the up or down arrow the character falls off the ladder, I want him to stay on the ladder unless he is either at the top or bottom.

    As usual any and all help is greatly appreciated.

    Bilko

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • A ladder system that works

    1.object ladder

    2. object player

    if player overlays ladder

                               -> Platform disbled

    sub event

    on key pressed Up -> Set player.animation to "climb"

                         player.y = y+1 (or whatever you want)

    on key pressed down -> same theory as above

    Now to "dismount"

    find out x,y of locations where you want to exit

    player.y > location.y -> platform enabled

                               player.animation = "default"

    The above MAY work, i did not test it since i do not have construct at hand right now.. if no one posts any solution until i'm home i may post a working example.

  • I don't see where you are setting the player animation to "Climb" anywhere. Did you delete it from event where the player is overlapping lader_climb? (I would think it would come right before or after the setting X action.

    Anyway, here is a sample that I was playing around with. When the player overlaps the ladder the platform behavior is disabled and he starts climbing. When Space is pressed if the player is climbing then the platform behavior is enabled and climbing is turned off. So there is no dismount area. The player can dismount anytime and suffer the consequences. But it does stay put on the ladder.

    ClimbingTest.capx

    Note if player is red default animation is playing, if purple climb animation is playing.

    EDIT:This was created with R83, so you would need to update C2 if you haven't already. Here are my events:

    <img src="http://dl.dropbox.com/u/57899112/ClimbTestEvents.PNG" border="0">

  • Thanks for all your help guys, I had to get help re-writing most of my logic lol I just was way to over complicated. It is all sussed now.

    Thanks again.

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