TheKingsRace/Assets/Scripts/KingScripts/KingAbilities/Goo.cs
Katherine f20dbd6032 Implemented Hail and reoganised Abilities
>Hail is spawned at a rondom spot in an area
>Hail creates a Shadow directly underneath it
>Hail falls, and shadow scales to the correct size
>Abilites moved into their own folder
>King Implementation Scene Created and King Movement Created
2021-11-17 12:27:35 -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);
}
}