Help - Instantiate semicolon error

Hi all, i’m just trying to destroy my particle system and i get this source, but it didn’t work properly, and i wonder, the error was insert semicolon at the end, and i have my semicolon there, i don’t understand the error at all, anyone can help me here.

my error :
Assets/scriptEnemy.js(23,35): UCE0001: ‘;’ expected. Insert a semicolon at the end.

this is my code :

if(explosion){
	GameObject newExplosion = (GameObject) Instantiate(explosion, transform.position, transform.rotation);
	Destroy(newExplosion,2);
}

Thanks :smile:

You’re trying to use C# syntax in a JS script.

–Eric

oh ya? sorry because i don’t know how what’s the differenn c# syntax and JS syntax.

I’m sorry again.

Thanks for your help :smile:

C# and JS are different languages that have different ways of writing things. If you’re going to use C#, then create a C# script, not a JS script.

–Eric