Assets/sprits/point.cs(24,39): error CS1525: Unexpected symbol `Destroy'
using UnityEngine; using System.Collections;
public class point : MonoBehaviour {
public TextMesh currSco;
public GameObject ballPref;
public Transform paddleObj;
GameObject ball;
int score;
void Update ()
{
ball = GameObject.FindGameObjectWithTag ("ball");
currSco.text = "" + score;
}
void OnTriggerEnter(Collider other)
{
if (other.tag == "ball")
{
score += 1
Destroy(ball);
(Instantiate(ballPref,new Vector3(paddleObj.transform.position.x + 2,paddleObj.transform.position.y,0),Quaternion.identity) as GameObject).transform.parent = paddleObj;
}
}
}
Comment
Your answer