Hello!
I’m new to coding, so please bear with me. I’m trying to create code for a powerup that will double the number of points received when other objects are picked up. Here’s what I have so far:
#pragma strict
var points : int;
var timer: float = 300; // set duration time in seconds in the Inspector
function Update () {
}
function OnTriggerEnter (col){
timer -= Time.deltaTime;
if (timer > 0)
{
OnTriggerEnter(){
points += (points * 2);
}
}
}
I do have a points mechanic already set up within my PlayerStatus script and the script for the other pickup. But I keep getting this error:
Error BCE0043: Unexpected token: col. (BCE0043) (Assembly-UnityScript)
I’ve tried replacing “col” with “Collider” and “Collision” and both of them give me this error:
Error BCE0017: The best overload for the method ‘doubleScore.OnTriggerEnter(Object)’ is not compatible with the argument list ‘()’. (BCE0017) (Assembly-UnityScript)
I’m at a loss. Anybody have any advice?