How do I set the animation for diagonal movement with 8D behavior?

0 favourites
  • 8 posts
From the Asset Store
3 pixel charaters with over 8 animations each + animations with a gun
  • Hello!

    How do I set the animation for diagonal movement without it also registering and interrupted by my plain old side movements?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That worked perfect except I am having another issue.

    So it now knows which direction I am facing but because it sets the angle on each turn its rotation my animations that I have already made to face the proper angle. But if I turn off set angle, it won't register the angle. Any tips?

    Example:

    On up, the up animation now turns left

    On down, the down animation now turns left

    On left, the left animation now turns right

    Is the fix to change my animations?

    Im using this wolf template:

    spriters-resource.com/pc_computer/puzzlequest/sheet/13146

    I hope this makes sense.

    Thank you for the help!

  • I'm not sure I follow. You need to change "Set angle" to "No" in 8Direction, and use Player.8direction.MovingAngle expression to determine which animation frame to select.

  • Ahhh that's what I was missing.

    Sorry for all these basic question but I really appreciate the help!

    So the numbers that the expression Player.8Direction.MovingAngle will give me will be the angle in numbers correct? But when I try and put my Global number, CurrentAngle to Player.8Direction.MovingAngle and display it in text so I can make sure I have the right numbers for my animation, it tells me "NaN" in the text box. I thought it was a integer not string.

    I guess what I'm asking is what is the variable Ill be getting if I'm moving, Right,Left,Up,Down,ect?

    Thank again <3

  • You didn't put "Player.8Direction.MovingAngle" in the global variable definition, did you?

    You should do this on every tick or when 8direction is moving. I recommend using system expression "Is within angle" or "Is between angles", they make life easier when dealing with angles. For example:

    Player.8Direction.MovingAngle is within 20 degrees of 0 : set animation "Left"
    
    Else
    Player.8Direction.MovingAngle is within 20 degrees of 45 : set animation "LeftDown"
    
    etc.
    
  • I dont understand how I am suppose to put that into the event sheet.

    So you do mean put Wolf.8Direction.MovingAngle into a global variable every tic and while hes moving.

    Then check if the number is between two numbers?

    OR

    How do I check if Wolf.8Direction.MovingAngle is between certain angle/numbers? The only options for 8D movement are if he is moving or compare speed.

    Thank you for your help, I know this is probably super simple and I'm messing something simple up...

  • No, don't put anything into global variable! :)

    Use System object - add "System Is between angles" or "System is within angle" condition. In the Angle field put Wolf.8Direction.MovingAngle expression.

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