"My interface scan returns nothing at runtime"
Scene.GetAllComponents<Component>().OfType<IInteractable>()compiles, runs, and returns nothing — even though interactable components are clearly in the scene. Prompts never appear; nearest-target logic always finds null.
Interface-based scene scans are unreliable in this engine. GetAllComponents<Component>().OfType<I…>() has been observed to return an empty sequence at runtime even when concrete implementors exist.
Keep an explicit union of concrete types:
public interface IInteractable
{
string GetPrompt(/* player */);
void Interact(/* player */);
}
static IEnumerable<IInteractable> AllInteractables(Scene scene)
{
foreach (var c in scene.GetAllComponents<Door>()) yield return c;
foreach (var c in scene.GetAllComponents<Chest>()) yield return c;
foreach (var c in scene.GetAllComponents<Workbench>()) yield return c;
// one GetAllComponents<T> per concrete implementor
}Cache the list on a short timer (e.g. 0.25 s) if you scan every frame.
Pick nearest whose prompt is non-null — components can decline (healthy panel → no prompt; damaged → "re-anchor").
UX that works: floating marker over the target (bounds-top + bob) + a [F] prompt line in the HUD.
GetAllComponents<T> is typed against concrete Component subclasses the scene graph knows how to enumerate. Filtering a broad Component query by interface does not reliably surface those instances at runtime — so you pay the boring explicit list and get correct results.