The question is answered, right answer was accepted
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?
You might be better off with a pseudo-3D game ins$$anonymous$$d, honestly.
@$$anonymous$$ewEight Similar to the 2D Scrolling Space Shooter tutorial on the Unity Learn website, where the actual development area is 3D but the game looks 2D. It allows you to use 3D shapes on a 2D game.
Answer by hulahoolgames · Sep 01, 2015 at 03:26 AM
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.
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.
I don't quite understand what you mean by player jumping from one place to another.
its like how to prevent the player from lifting his finger and just placing it on another point of the wire.
Okay, I was thinking on similar lines. You can detect Touch phases like Began(finger touched screen), $$anonymous$$oved (finger was dragged o screen), ended (finger was lifted) etc. You can move the ring only during the moved phase. In the Began phase you can put logic that starts moving the ring only when you place the finger again within a certain radius of the ring current position and again move the ring in the moved phase. Hope that makes sense.
Follow this Question
Related Questions
Best way for object with many gameObjects 0 Answers
Unity 5.0 Sprite slicing messes up with much vertices. 0 Answers
Detection system 0 Answers
Unity 2D sprite animation is tearing. 0 Answers
Is it possible to create a texture that hides a specific texture? 0 Answers