Hello Everyone i want to know how to make the Raycast Thicker
i use this code
if(Physics.Raycast(transform.position + new Vector3(0,0.6f,-1.6f),transform.TransformDirection(Vector3.forward),out hit)){
}
Hello Everyone i want to know how to make the Raycast Thicker
i use this code
if(Physics.Raycast(transform.position + new Vector3(0,0.6f,-1.6f),transform.TransformDirection(Vector3.forward),out hit)){
}
float thickness = 1f; //<-- Desired thickness here.
Vector3 origin = transform.position + new Vector3(0,0.6f,-1.6f);
Vector3 direction = transform.TransformDirection(Vector3.forward);
if (Physics.SphereCast(origin, thickness, direction, out hit)) {
...
}
You can’t make a raycast thicker; a ray by definition is one-dimensional. You can try using a spherecast instead.
spherecast is spherecast. you can use multiple raycasts(like 3 or 4) in a small area to simulate a Thicker raycast.
– Tasty_Risottoi want thicked raycast because i need this : when i'm aim on the box, will show GUI.label "its a Box" but with raycast its only show when i AIM i need it to showup when the box in range around the raycast any ideas? and sry for bad english
– D3m0nEAnd for 2D projects, you could use CircleCast ![]()
I didn't realise a SphereCast worked this way! I thought SphereCast was the same as CheckSphere >< Purged my silly suggestions and rating you guys up :)
– Tarliushow do i see a debug.drawray of it? tanks!
– araz01