- Home /
Error with BrickBreaker CS0119
I am getting Error CS0119: Expression denotes a 'value', where a 'method group' was expected.
i am using Unity 2.5
My code:
using UnityEngine; using System.Collections;
public class BallScript : MonoBehaviour {
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update ()
{
}
public void Die()
{
Destroy( gameObject );
GameObject paddleObject = GameObject.Find ("Paddle");
PaddleScript paddleScript = paddleObject.GetComponent(typeof(PaddleScript))();
paddleScript.SpawnBall();
}
}
Comment
Answer by GameVortex · Dec 16, 2013 at 02:30 PM
You have too many parentheses at the end of the GetComponent line. Maybe you added your own and the autocomplete added some as well? Just remove the two last ones and it should work fine.
Your answer
![](https://koobas.hobune.stream/wayback/20220613124257im_/https://answers.unity.com/themes/thub/images/avi.jpg)