Difficulty with event resetting animation over and over

This forum is currently in read-only mode.
From the Asset Store
14 amazing sound files of game events like Level Ups, Level Completes, object spawn, object taking etc.
  • So basically, here's the deal: I have an object with a platform movement behavior that holds the place of what would ordinarily be the character. The character is always set to the hotspot of the object, so it looks like he is the one with the platform behavior. This prevents the character's hat and legs from getting caught on the side of backdrops.

    My problem is that when I'm trying to set the character object's animation to "Running," the way I have the event set up:

    'Placeholder' is walking: Set 'Character' animation to "Running"[/code:23g5e76m]
    
    means that the character's animation is constantly reset to the first frame of Running, eliminating the showing of the other 2 frames in the animation. How do I fix this? I've tried 'Trigger once while true' and it didn't work. Kindly help. XD
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • My problem is that when I'm trying to set the character object's animation to "Running," the way I have the event set up:

    'Placeholder' is walking: Set 'Character' animation to "Running"[/code:333lwl71]
    
    means that the character's animation is constantly reset to the first frame of Running, eliminating the showing of the other 2 frames in the animation. How do I fix this? I've tried 'Trigger once while true' and it didn't work. Kindly help. XD
    

    If you just switch 'Character' to running, 'Placeholder' stays in the walking state. So this action is called every frame. You could switch the 'Placeholder' state (animation) also , keep track of the state using a global/private variable or test for the current animation of 'Character'.

    The latter would look something like this:

    +'Placeholder' is walking

    [Invert]'Character' animation "Running" is playing-> Set 'Character' animation to "Running"

  • [quote:2imxuqvf]+'Placeholder' is walking

    [Invert]'Character' animation "Running" is playing-> Set 'Character' animation to "Running"

    Thanks for the idea. I tried this, but nonetheless, the character's "running" animation stays stuck in the first frame. I don't really understand what the issue is... ._.

  • Maybe there's still something else interfering with the animations. It would sure help a lot if you shared the cap.

    Other than that there's a pretty easy way to use animations with a dummy sprite. Just give your Dummy (the placeholder) all the animations of your actual character sprite - or rather those that can be tagged. For all those animations use one and the same frame, so the placeholder won't actually change shape or appearance.

    So you'd have animations like Walking, Jumping etc. on your dummy and your character sprites. The exact same animation names. Now add the proper tags to the animations of the dummy, which is the object which actually has Platform Behavior. If you don't know about tags they can be set to the left in the properties bar when you click on an animation name. So your jumping animation gets the tag Jumping of course and so on...

    Now all you need to do is set the animation of your character to the animation name (sprite.animname) of your dummy in an always event. You can see a setup like this here: http://dl.dropbox.com/u/2306601/tut02.rar

    Sorry for the german names in the cap, but it's part of a german construct beginner's tutorial I made a while ago.

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