Commit 565ac2ee authored by Simon Hetzer's avatar Simon Hetzer
Browse files

ball spawns above player

parent 1f1421d2
......@@ -7,6 +7,11 @@ public class Score : MonoBehaviour
[SerializeField]private Vector2 spawnLeft;
[SerializeField]private Vector2 spawnRight;
[SerializeField] private Transform playerLeft;
[SerializeField] private Transform playerRight;
[SerializeField] private IntValue spawnHight;
private void Start()
{
......@@ -21,12 +26,12 @@ public class Score : MonoBehaviour
if (other.transform.position.x < 0)
{
rightValue.value++;
other.transform.position = spawnRight;
other.transform.position = playerRight.position + new Vector3(0,5,0);
}
else
{
leftValue.value++;
other.transform.position = spawnLeft;
other.transform.position = playerLeft.position + new Vector3(0,5,0);
}
other.gameObject.GetComponent<Rigidbody2D>().velocity = Vector2.zero;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment