Forum rules - please read before posting.

Debug Raycast

How can I visualize the raycast debug line between my FPSController and the Hotspots? I'm having an issue where one of my Hotspots isn't being detected consistently, and I want to understand why this is happening. I believe I've seen a way to do this before, but I can't remember how or find the information now.

Comments

  • The most common cause of this issue - provided the Hotspot is close enough - is that there's another collider on the Default layer in between it and the MainCamera.

    AC's Hotspot-detection raycasts occurs in the PlayerInteraction script's CheckForHotspots function.

    If you look for the line within this:

    if (Physics.Raycast (ray, out hit, KickStarter.settingsManager.hotspotRaycastLength, HotspotLayerMask))
    

    Just above, copy/paste:

    Debug.DrawRay (ray.origin, ray.direction * KickStarter.settingsManager.hotspotRaycastLength);
    

    That will draw the ray in the Scene window.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.