Quantcast
Channel: Latest Questions by Griffo
Viewing all articles
Browse latest Browse all 94

Set a variable to a collider type.

$
0
0
I'm trying to set a variable to a collider type. When a particle hits an enemy I want it to see what type of collider it has just hit, box, capsule or sphere . I thought something like this would work private var col : Collider; private var colCenter : Vector3; col = _enemy[i].Transforms.gameObject.GetComponent.(); var colType = col.GetType(); colCenter = _enemy[i].Transforms.position + colType.center; But I get the error .. 'center' is not a member of 'System.Type' Also tried private var colCenter : Vector3; var col = _enemy[i].Transforms.gameObject.GetComponent.().GetType(); colCenter = _enemy[i].Transforms.position + col.center; But still get the error .. 'centre' is not a member of 'System.Type' Any help please, thanks.

Viewing all articles
Browse latest Browse all 94

Trending Articles



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