Im new to unity and making scripts.
Im trying to make a script to pick up my coins but I keep getting 3 errors that i cant seem to fix.
here are the errors:
error CS0119: Expression denotes a type', where a
variable’, value' or
method group’ was expected
error CS1502: The best overloaded method match for `UnityEngine.Object.Destroy(UnityEngine.Object)’ has some invalid arguments
error CS1503: Argument #1' cannot convert
object’ expression to type `UnityEngine.Object’
and here is my code for the coins
using UnityEngine;
using System.Collections;
public class CoinPickup : MonoBehaviour {
public int pointsToAdd;
void onTriggerEnter2D (Collider2D other)
{
if (other.name == "Character") {
ScoreManager.AddPoints (pointsToAdd);
Destroy (GameObject);
}
}
}