Platform Behaviour: Animation mode - accessible with events?

0 favourites
  • 10 posts
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • Hi, I'm using the default platform behaviour - in debug mode if you look at how it operates there is an un-editable variable called "Animation Mode" which changes depending on whether the object is stopped, moving, jumping or falling. I can see that this is obviously how the default platform behaviour keeps track of what the player is doing but I'm wondering is there a way I can force the mode. The problem is that if my character jumps or falls and is then pinned to an object in the air - even though it is no longer moving/falling the animation mode still thinks that it is jumping or falling. I would like to force reset this to "stopped" as it is causing issues with what I'm trying to do. Is there any way to overwrite this? Or am I better off looking at custom movement (want to avoid this if possible).

  • Sorry, I meant to post this in the C2 area - may not be applicable to C3...?

  • couldn't you simply work around this by setting the animation to a different one when this pinning takes place?

  • Not in this particular case, the problem is that when the object is returned to a platform it continues on from the state it thinks it's in so for example if it thinks it's falling then when placed onto another platform it will force a land, which in turn triggers a land animation, which I don't want. I have found some workarounds, but none seem to be working consistently, and are causing erratic behaviour, which is why I would prefer to control the animation mode by events rather than let it do it's own thing.

  • Started up my own platformer to check it out, I see your issue and it answers a lot of qeustions for me.

    When I was working on it I had issues with it as well, I eventually switched to physics based movement and worked out the animations events manually. So I'm afraid I can't help you with this particular problem.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Does it help if upon pinning you manually set the platform behavior Vector X and Vector Y to 0? You might also give your character variables such as "running", "climbing" etc. and change the animation based on boolean states.

  • I thought that setting vector x and vector y to 0 would fix this too, but it doesn't appear to. When the object is returned to a platform it still continues from where it left off and triggers unwanted animations (even if the hitbox doesn't necessarily move, or appear to move). It would be really good to have control over the states so that I could just set it to "stopped" therefore overwriting the land animation (when necessary). Giving the character a bunch of variables and changing animations depending on what's happening is a good idea, but I'm thinking it may still have the same problem - because I have a landing animation and would need to call it when "on landed" happens - which is still part of the inbuilt platform behaviour - and since that is what is triggering when I don't want it to, it would probably still trigger.

  • Here's an example of what I mean. If you play the attached file when you jump with up key near a ledge the character will hold onto it (the state of the hitbox will be jump) if you press z, an animation will play and hitbox will be teleported up to the ledge. If you're jumping this seems to work ok - although it was a headache to even get that far and another user worked out that I needed to set a small offset to stop construct triggering the jump animation. The problem now, is that if you catch the ledge when falling (try jumping from one pillar to the other and grabbing the ledge) when the character pulls themselves up it triggers the fall animation straight after the hitbox teleports. Already, the system I have had to set up is very 'hacky' and not very good. It could be made much more elegant and could probably actually work with control over those states.

    https://www.dropbox.com/s/yay2q8g52c7t7 ... t.c3p?dl=0 <--- C3 file

    https://www.dropbox.com/s/mhsh6fknxes04 ... .capx?dl=0 <---- C2 file

  • signaljacker

    Not the most elegant solution, but one way to fix this would be to make a group "Land" and put the "Platform: On landed" animation events inside the group.

    Then, under "Is Z pressed.." tree of events, add System-> Set group "Land" deactivated.

    Then, under both "On animation "hang_climb" finished event trees, at the end add "System -> Wait 0.5 seconds" and "Set group "Land" activated".

  • Waltuo - thank you for a solution - it does indeed work.

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