Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class Spikes : MonoBehaviour {
- public Player player;
- public int damage = 2 ;
- // Use this for initialization
- void Start () {
- player = GameObject.FindGameObjectWithTag("Player").GetComponent<Player>();
- }
- private void OnTriggerEnter2D(Collider2D col)
- {
- if (col.CompareTag("Player"))
- {
- player.Damage(damage);
- player.Knockback(400f, player.transform.position);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement