TheKingsRace/Assets/Scripts/KingScripts/Goo.cs
Katherine 35c5c41f5a Slime Temp and Bug fixes
>Fixed some bakes with the Hail
>Fixed the movement bugs with the king's movement
>Added the Slime in a semi-functional state
2022-02-10 15:54:16 -06:00

29 lines
680 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Goo : MonoBehaviour
{
int Lifetime = 0;
void FixedUpdate() {
Lifetime++;
if(Lifetime == 950) {
Destruction();
}
}
//Makes the player sliperly whenever they step on the goo
void OnTriggerEnter(Collider other) {
if (other.tag == "Player") {
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);
}
}