Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

How to set a BoxCollider to a variable, and disable it?

$
0
0
I'm stuck on something which I thought would be simple. I need to disable the BoxCollider on my projectile when it hits something. I don't want to delete it straight away, because it has a particle trail which needs to finish, so I thought hiding the graphic and disabling the BoxCollider would do the trick. This doesn't work, but I thought it would: private var collider : BoxCollider; function Start () { collider = GetComponent.(); } function OnTriggerEnter(other: Collider) { collider.isActive(false); } I get the error *"Language feature not implemented: Ambiguous(BulletScript.collider, UnityEngine.Component.Collider)* I definitely have a Box Collider on the object this script is on. Any ideas guys?

Viewing all articles
Browse latest Browse all 1875

Trending Articles



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