How do I Mirror Non Platform - Non Directional Sprite

0 favourites
  • 4 posts
From the Asset Store
The complete source file for my Youtube platformer game tutorial series.
  • I have a sprite moving via the rex_moveto behavior. Everything is fine, it moves around from waypoint to waypoint, but I cannot for the life of me to mirror the sprite based on the direction its moving. I have done this before, but cannot find the example capx I did it in. Anyone have any tips?

  • You can use the sine behavior like this example:

  • I've looked at that one. The way points my sprites follow are random though. Isn't that example based off touching an invisible sprite which turns them? I had gotten the sprites to mirror when the moving angle was 180 or 0, but it only worked some of the time and that's probably because when they move they could be going slightly up or slightly down so the angle isn't exactly 180 or 0.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I figured it out. If anyone else runs into this issue, and doesn't want to use sine, or platform, or any other behavior in a work around fashion this is how I did it.

    Get the plugin rex_moveto -

    For Debug purposes I set it up to update a instance variable on my sprite so I could see the angles.

    Create Instance Variable - MovingAngle (number)

    Add Event - Sprite -> (condition) MoveTo is moving

    Action - Set Sprite MovingAngle to Sprite.MoveTo.MovingAngleStart

    Add Event - Sprite -> (condition) Compare Instance Variable MovingAngle > 90 AND MovingAngle < 270

    Action - Set Mirrored

    Add Event - Sprite -> (condition) Compare Instance Variable MovingAngle > 270 OR MovingAngle < 90

    Action - Not Mirrored

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