Quantcast
Channel: Questions in topic: "drawray"
Viewing all articles
Browse latest Browse all 92

DrawRay with a custom class.

$
0
0
I have 2 simple scripts witch have to dray a ray from an objects position upwards but it dosent do anything, --the class witch draws the ray #pragma strict class aClass { var pos : Transform; function Update() { if(pos != null) { Debug.DrawRay(pos.position,Vector3(0,10,0), Color.red); } } } --the script witch sets the transform #pragma strict var grid : aClass = new aClass(); function Start () { grid.pos = gameObject.transform; } The scripts are rather simple but it dosent work and it dosent have any warnongs or errors.What am I doing wrong?

Viewing all articles
Browse latest Browse all 92

Trending Articles



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