I am working on a visualization program, I need to get the HHitProxy under the mouse cursor in play time
I have overridden UGameViewportClient::RequiresHitProxyStorage() to return true.
Uworld and FScene both have hitproxy enabled and I checked with debugger FDefferdShaderSceneRendere::RenderHitProxies is called but Viewport->GetHitProxy() always returns zero.
thats the code I am using
bool UTestGameViewportClient::RequiresHitProxyStorage()
{
return true;
}
void UTestGameViewportClient::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
check(this->GetWorld()->RequiresHitProxies());
check(this->GetWorld()->Scene->RequiresHitProxies());
//always returns null
if (HHitProxy* hproxy = Viewport->GetHitProxy(Viewport->GetMouseX(), Viewport->GetMouseY()))
{
}
Viewport->InvalidateHitProxy();
}