Automate slide animation

0 favourites
  • 10 posts
From the Asset Store
4 Block Soldiers with different animations, 400x400
  • Hi guys,

    This is my first post here, so please dont be angry if this has been asked before :)

    How can i make a character automatically play a slide animation when the ground is no longer horizontal ? And how would i make it normal again ?

    I have included an example pic for you.

    Thank you.

    <img src="http://s23.postimg.org/7w5tzshy3/Example.jpg" border="0" />

  • Assuming you are using two different objects for flat floor and angled floor...

    When Player is On Floor (Cond: Floor is flat) > Play animation Normal

    When Player is On Floor (Cond: Floor is angled) > Play animation Slide

  • Hi Plinkie,

    Thank you very much for helping me out. I will try and implement that and see how it goes <img src="smileys/smiley20.gif" border="0" align="middle" />

  • where do I find the "Floor is Flat" and "Floor is Angled" Condition?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • These are not pre-existant conditions. When you create your floor objects, create an instanve variable that defines the type of floor it is (flat or angled). Then in your consition, look at that instance variable to determine the type of floor.

  • dzaky Alkaff

    By that I meant When Player Is On Floor(Player is colliding with flat floor object)

    If you don't plan to use multiple floor objects you can use variables to determine the angle that the floor is at, therefore floor is flat=0degrees so When Player Is On Floor(FloorAngle=0)

  • Sorry to be a bother but im getting confused with Instance variables. Im not sure if it should be a boolean or a number and how an animation is attached to that ?

    Would it be ok if you showed me a basic example ?

    Thank you :)

  • I managed to get something kind of working using "On collision with"

    but i cant get the animation to play on an angle to match the surface and then go back to normal again. This is a little tricky for a newbie !

  • Creepers just a humble advice: if you are not already doing so, use a rather small, invisible rectangle sprite for all your character interactions, such as collision checks, arranging angle etc. Then pin your animations sprites on top of it. This way it's easier to arrangle angles, do stuff, and prevent some jittery animation/collision bugs. A good idea is to place the origin point of the rectange to bottom mid. Thera re nice tutorials from reddit university on youtube where this is explained thorougly. And please forgive if you are already doing all these :)

  • Windwalker, Thank you for giving me this information. I will do exactly as you suggest and hopefully will get a working solution <img src="smileys/smiley20.gif" border="0" align="middle" />

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