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 BlueCollider : MonoBehaviour {
- Collider2D m_Collider;
- public float width;
- void Start()
- {
- //Fetch the GameObject's Collider (make sure it has a Collider component)
- m_Collider = GetComponent<Collider2D>();
- width = GetComponent<BoxCollider2D>().size.x;
- }
- void Update()
- {
- if (PlayerController.playerColor== 3)
- {
- //m_Collider.enabled = false;
- m_Collider.isTrigger = true;
- }
- else
- {
- //m_Collider.enabled = true;
- m_Collider.isTrigger = false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement