-2
\$\begingroup\$

here is my script :

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;    

public class powerup : MonoBehaviour {

    public float multiplier = 2f;
    public float duration = 4f;
    
    public GameObject PickupEffect;

    void OnTriggerEnter (BoxCollider other)
    {
        if(other.CompareTag("Car"))
        {
            startcoroutine   (  Pickup(other));
        }
    }

    IEnumerator Pickup(BoxCollider Car)
    {
        Instantiate(PickupEffect, transform.position, transform.rotation);
        Car.transform.localScale *= multiplier;    
        yield return new WaitForSeconds(duration);

        Car.transform.localScale /= multiplier;


        Destroy(gameObject);
    }
}
\$\endgroup\$
1
  • 1
    \$\begingroup\$ Hello, You should use StartCoroutine instead of startcoroutine. c# is case sensitive. \$\endgroup\$
    – Mangata
    Jul 13 at 9:10

1 Answer 1

2
\$\begingroup\$

It's StartCoroutine, not startcoroutine. C# is a case-sensitive language. Capitalization matters.

\$\endgroup\$
0

Not the answer you're looking for? Browse other questions tagged .