TheKingsRace/Assets/Scripts/KingScripts/Goo.cs
Vincent Wheat 7348d3644d MetaData + Spawn Quaternions
-Meta data for moved king scripts
-Added quaternions for spawning players facing the correct directions
2021-12-10 21:58:55 -06:00

27 lines
621 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Goo : MonoBehaviour
{
int Lifetime = 0;
void FixedUpdate() {
Lifetime++;
if(Lifetime == 550) {
Destruction();
}
}
//Makes the player sliperly whenever they step on the goo
void OnTriggerEnter(Collider other) {
Debug.Log("Slippy!");
GameObject player = other.gameObject;//Turns the collider into a game object
player.GetComponent<PlayerStats>().Traction = 1.5f;//Make it slippy
}
void Destruction() {
Destroy(gameObject);
}
}