Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

code won't work

$
0
0
This code does not work even with a box collider set to is trigger.What would be causing this?

Code (CSharp):
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class DestroyCubes : MonoBehaviour
  5. {
  6.     void OnCollisionEnter (Collision col)
  7.     {
  8.         if(col.gameObject.name == "prop_powerCube")
  9.         {
  10.             Destroy(col.gameObject);
  11.         }
  12.     }
  13. }

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>