Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

overloaded Raycast

$
0
0
So ive been looking around, and I cant find a clear answer for this. I thought by asking this I might be helping others too. So I'm trying to raycast from a point downwards, and check if it hits a certain collider. I wanted to limit it to raycast to about 2000, but I keep on getting the overloaded error: Assets/treeTool/treeTool.cs(77,52): error CS1502: The best overloaded method match for `UnityEngine.Physics.Raycast(UnityEngine.Ray, float, int, UnityEngine.QueryTriggerInteraction)' has some invalid arguments from the code : RaycastHit treeHit; Ray treeRay = new Ray (currentTreeRayPos, Vector3.down); if(Physics.Raycast(treeRay, 1000, out treeHit, landOnly)){ if (treeHit.collider.GameObject.tag == "land") { Instantiate (tree [0], treeHit.point, Quaternion.identity); } } It seems there isn't enough space in a raycast to specify the start point, direction, max distance, out hit, and a layermask....... I'm rattling my brain (and google) trying to find a straight answer, any help u can give is appreciated. Thanks ^-^

Viewing all articles
Browse latest Browse all 7934

Trending Articles



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