I’ve got a capsule cast i want to match the position and rotation of, which I have done successfully but I also want to be able to set the “width” of the capsule. So far everything I’ve tried hasn’t worked. If anyone could explain it to me I would be very grateful.
Also, I’m using BgTools’ CastVisualizer to basically Debug.Draw the capsule; that’s how I can tell its working.
public class CapsuleCastTest : MonoBehaviour
{
public Transform wheel;
private Vector3 point1;
private Vector3 point2;
public Vector3 width;
public float radius;
void Update()
{
point1 = wheel.position - wheel.forward - width;
point2 = wheel.position + wheel.forward + width;
RaycastHit hit;
if (Physics.CapsuleCast(point1, point2, radius, wheel.forward, out hit, 0f))
{
Debug.Log("CapCast Hit");
}
}
private void Start()
{
radius = 0.5f;
}
}