So I have a car with a rigidbody (uses wheel colliders) and a door with a collider. Whenever I mouse over the edge of the door, the raycast literally goes through it every other frame and causes the text to blink. Super annoying.
This does NOT happen when rigidbody interpolate is set to “None”.
if (Physics.Raycast(PlayerCamera.transform.position, PlayerCamera.transform.forward, out hit, 50, 9)) {
if (hit.collider.transform.name == "Handle") {
PickUpItemCanvasText.GetComponent<Transform>().position = PlayerCamera.GetComponent<Camera>().WorldToScreenPoint(hit.collider.transform.position);
}
}
kpnbqx