- Home /
Physics.SphereCast please help understand
Im trying to check if ball is touching somethink from the down, front and back site. Scale of sphere gameobject is 1, 1, 1. I was trying to do like this: if(Physics.SphereCast(sphere.transform.position, 1, sphere.transform.transform.front, out Hit, 1)) and this not working or think somethink is touching even is nothink touching this. There is no .down, how can i check down site? Physics.IgnoreCollision will work with this if I want to ignore Parent gameobject?
Your question isn't related to Physics.SphereCast, it's a question on relative transform directions.
Your code isn't working because transform.front
doesn't exist. You probably want transform.forward
. As for "down", use -transform.up
.
Your answer
Follow this Question
Related Questions
Lay a Sphere on a Point 3 Answers
How do you perform a stationary SphereCastAll? 1 Answer
SphereCast and CheckSphere failing to catch collisions. 1 Answer
Using Trigonometry for Collision Detection 0 Answers
Help with a field of sight 3 Answers