I am having a very odd issue with my gizmo using the ITF and I’m at a loss. It’s like the gizmos “hit boxes” are not where they are visually and I cannot figure out why. I made a debug trace to confirm that my mouse is going to the gizmo as intended and it is so I’m not sure whats going on. Example can be seen in the video below
Tick for overlaps/interaction
FInputDeviceState InputState = CurrentMouseState;
InputState.InputDevice = EInputDevices::Mouse;
FModifierKeysState ModifierState = FSlateApplication::Get().GetModifierKeys();
UGameViewportClient* ViewportClient = GetWorld()->GetGameViewport();
// update modifier keys
InputState.SetModifierKeyStates(
ModifierState.IsLeftShiftDown(),
ModifierState.IsAltDown(),
ModifierState.IsControlDown(),
ModifierState.IsCommandDown());
if (ViewportClient)
{
FSceneViewport* Viewport = ViewportClient->GetGameViewport();
APlayerController* PC = UGameplayStatics::GetPlayerController(GetWorld(), 0);
ContextQueriesAPI->UpdateActiveViewport(Viewport);
FVector WorldLocation, WorldDirection;
FVector2D ViewportMousePos;
PC->DeprojectMousePositionToWorld(WorldLocation, WorldDirection);
PC->GetMousePosition(ViewportMousePos.X, ViewportMousePos.Y);
InputState.Mouse.Position2D = ViewportMousePos;
InputState.Mouse.Delta2D = CurrentMouseState.Mouse.Position2D - PrevMousePosition;
PrevMousePosition = InputState.Mouse.Position2D;
InputState.Mouse.WorldRay = FRay(WorldLocation, WorldDirection);
FVector Start = WorldLocation + WorldDirection * 25.0f;
FVector End = Start + WorldDirection * 800.0f;
DrawDebugLine(GetWorld(), Start, End, FColor::Red, false, -1.0f, 0, 0.2f);
if (bInCameraControl)
{
ensure(bPendingMouseStateChange == false);
ensure(ToolsContext->InputRouter->HasActiveMouseCapture() == false);
ToolsContext->InputRouter->PostHoverInputEvent(InputState);
}
else if (bPendingMouseStateChange || ToolsContext->InputRouter->HasActiveMouseCapture())
{
ToolsContext->InputRouter->PostInputEvent(InputState);
}
else
{
ToolsContext->InputRouter->PostHoverInputEvent(InputState);
}
// clear down or up flags now that we have sent event
if (bPendingMouseStateChange)
{
if (CurrentMouseState.Mouse.Left.bDown)
{
UE_LOG(LogTemp, Warning, TEXT("MOUSE DOWN"));
CurrentMouseState.Mouse.Left.SetStates(false, true, false);
}
else
{
CurrentMouseState.Mouse.Left.SetStates(false, false, false);
}
bPendingMouseStateChange = false;
}
// tick things
ToolsContext->ToolManager->Tick(DeltaSeconds);
ToolsContext->GizmoManager->Tick(DeltaSeconds);
}