guys ı made a game like head soccer but ı couldnt made a score line system have some one else got a coding about it becouse my games graphics,main menu,movement of charackters are already ready but ı havent got score line system
I’m not sure what you mean when you say “score line system”. Do you mean like a goal line? For detecting when a goal is scored?
yes a goal line
I want a coding that will detect the goal and rewpawn the players in the same time show the goal in scoreboard
You can accomplish this using colliders. Your ball must also have a collider in order to detect it.
Add a gameobject with a box collider, check the box on it for “Is Trigger”.
If you need a special shape, use Polygon Collider, and you can edit the shape yourself.
Then in a script on that gameobject, add the function “OnTriggerEnter2D”.
http://docs.unity3d.com/ScriptReference/Collider2D.OnTriggerEnter2D.html
That function will be called when another object with a collider overlaps the collider. Inside that function you can check if the other object is the ball, and if it is, handle what happens when a goal is scored.
Check out this tutorial for more info on Colliders: