Quantcast
Channel: Latest Questions by CallToAdventure
Viewing all articles
Browse latest Browse all 62

Raycast Hit Distance

$
0
0
I have a target object - literally a target with three hit zones - about 20% of the target is the bull's eye zone, outward another 50 to 70 % is the great hit zone and the rest, towards the rim of the target is the hit zone with the lowest score. My problem is that I cannot properly define in script the correct distance; I am using raycast for this. var _hitDistance:int = Mathf.Round( Vector2.Distance( _thisTransform.position, hit.collider.transform.position) * 100); if ( _hitDistance <= BullsEyeHitDistance ) //bullseye hit

Viewing all articles
Browse latest Browse all 62

Trending Articles



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