Pick by comparisons for Reflections

0 favourites
  • 2 posts
From the Asset Store
See how your Logical Resolution looks on different devices
  • I've got a section in my game where the player has a reflective surface on either side of them. I've created a left and right reflection sprite and used "System - Pick by Comparison" to move them horizontally closer and further from the player as the player moves relative to the reflective surface. Currently I have the event sheet set up with:

    Every Tick: PlayerReflectionLeft - Set Y to Player.Y

    PlayerReflectionRight - Set Y to Player.Y

    System: Pick Player where Player.8Direction.VectorX >0

    - PlayerReflectionLeft - Set X to SelfX-1

    - PlayerReflectionRight - Set X to SelfX-1

    System: Pick Player where Player.8Direction.VectorX <0

    - PlayerReflectionLeft - Set X to SelfX+1

    - PlayerReflectionRight - Set X to SelfX+1

    This works perfectly as long as the player only moves horizontally, but as soon as you start moving the player vertically, the reflections both start moving to the left (presumably they're reverting to the Set X to SelfX-1 instruction). The reflections should only change their X when the player is moving horizontally, not vertically. What am I missing?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Interesting! I've managed to fix this by adding the condition

    "System - Pick by Comparison: Player.8Direction.MovingAngle=0" to the "VectorX>0 condition"

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