Dont touch the wire games

Curious on a few things.

  • How to make some parts of the sprite above the wire and some parts of the sprite behind the wire.
  • What logics should be used, ie. colliders? raycasting?
  • How to make sure the player dont jump from one place to the other?

alt text

  1. Assuming you are talking about the “ring” object in the scene, one thing you can try is cut up the ring sprite in two halves and align them to form the ring and have a common parent for them, so that you can move the parent to move them both. Then you can have the wire and these two ring halves be on the same “Sorting Layer”. Give the ring sprite behind the wire “Order in Layer” value of 0, give the wire value of 1, and give the ring part in front of the wire a value of 2. You can find a tutorial on sorting layers here.
  1. You can keep small colliders at the ends of the ring and the wire. I think with raycasting you might have to constantly keep checking if the ring ends overlapped with the wire.

  2. I don’t quite understand what you mean by player jumping from one place to another.