Animation and rotation question

0 favourites
  • 11 posts
From the Asset Store
Ninja char for your game! Make your own Shinobi game with this art.
  • Is there a way to display the sprite's animation in such a way that it stays facing one direction, independent of the sprite's angle variable? My MOB's AI uses the sprite angle a lot, but if I do 3/4 view I need the sprites to remain standing "upright" and not flip all over when changing direction.

  • are you just needing to add "set flipped" and/or "set mirrored" when they change direction? or is it more complicated than that?

  • Why don't you add instance variables that states different conditions for different animations ? Then add another condition to strict the direction of your sprite must facing to.

  • spacedoubt That would be the next step if I could get the sprite image/animation to not rotate in the first place. alextro I am not sure what you mean. How would another variable straighten out the direction of sprite facing?

    I could solve this problem by making my sprite invisible, and pinning another sprite to to it with the proper graphics, and setting the pin options to "position only". But that would be an inelegant solution that adds more complexity to an already complex entity. At least it should give you a better idea what I'm asking though.

  • Well, what is the sprite's angle variable for, if not to change the sprite's angle? is there an angle of motion involved? I'm not quite clear on what exactly you're trying to do.. maybe try changing the "set angle" on whatever you're using to make them move.

  • maybe this is what you want to achieve

  • It sounds to me like you want the sprite to face one direction with is angle variable, which is independent of the direction that it is moving. You can do this, it depends on how you're moving the sprite.

    For example, if you're using the 8 direction behavior, one of the properties is "set angle" This has the options to set the angle of the sprite to the angle it is moving, to round the angle off to the nearest 90 or 45 degrees, or to not set the angle of the sprite depending on which direction it is moving. So what you would want is "Set angle: No"

  • If I got what you want, you should just use one invisible object for the logic (AI) and another one with the graphics pinned above it, for position only, this way the angle won't change.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Robsta

    That is exactly what I did on my example "Set angle: No". This kind animation setup suits high angle view

  • alextro oh cool. I wasn't able to view your .capx because you're using the beta version (I'm using latest stable version), so I had to guess what you did there.

  • caiorosisca alextro Using the invisible sprite for AI and a pinned sprite for Animations is exactly what I ended up doing. Not using 8-direction, but having options like the ones mentioned for 8-direction would be a nice feature. Thanks, it's working pretty good now.

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