Sport Growth Stack Change is a query and reply website for skilled and impartial sport builders. It solely takes a minute to enroll.
Anyone can ask a query
Anyone can reply
The perfect solutions are voted up and rise to the highest
Requested
Considered
22 occasions
right here is my script :
utilizing System.Collections;
utilizing System.Collections.Generic;
utilizing UnityEngine;
utilizing System;
public class powerup : MonoBehaviour {
public float multiplier = 2f;
public float length = 4f;
public GameObject PickupEffect;
void OnTriggerEnter (BoxCollider different)
{
if(different.CompareTag("Automobile"))
{
startcoroutine ( Pickup(different));
}
}
IEnumerator Pickup(BoxCollider Automobile)
{
Instantiate(PickupEffect, rework.place, rework.rotation);
Automobile.rework.localScale *= multiplier;
yield return new WaitForSeconds(length);
Automobile.rework.localScale /= multiplier;
Destroy(gameObject);
}
}
$endgroup$
1
lang-cs