32bit_jam_conjure/Assets/PlayerController.cs
2022-10-21 21:30:19 -04:00

30 lines
708 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour
{
[SerializeField]
private LayerMask stunLayerMask;
private GrappleHook grappleScript;
[SerializeField]
private float stunDuration;
// Start is called before the first frame update
void Start()
{
grappleScript = GetComponent<GrappleHook>();
}
// Update is called once per frame
void Update()
{
}
private void OnCollisionEnter(Collision other) {
if(((1<<other.gameObject.layer) & stunLayerMask) != 0){//Collided w/ somtehing that stuns
grappleScript.Stun(stunDuration);
}
}
}