I am having trouble with a bit of code that worked (I believe) in 4.25 but stopped working correctly in 4.26. Please forgive my ignorance but it’s not my code and I am unfamiliar with gizmos. Sorry if this is a no-brainer…
In the project I’m working on, CustomTransformGizmos are used for in-game runtime editing of actors, and are used in TranslateAllAxes, RotateAllAxes and ScaleAllAxes modes. It looks like there are custom gizmo features drawn in the Translate mode, but I don’t think these are relevant.
As you move away from the object being edited, the Gizmo remains scaled at uniform screen size (expected behaviour), but the hit detection on the gizmo manipulators appears to scale in world space. This is true of all of the editing modes (translate/rotate/scale).
I am not quite sure where the hit detection is happening - I assume within the gizmo code (in the InteractiveToolsFramework)? The problem affects both hovering over the gizmo elements (highlighting) and clicking on them.
Any pointers on this would be greatly appreciated.
Attached is an illustration of the problem.
Gizmo creation code is as follows:
if (SelectedActors.Num() > 0)
{
UTransformProxy* NewTransformProxy = NewObject<UTransformProxy>(this);
for (AActor* SelectedActor : SelectedActors)
{
NewTransformProxy->AddComponent(SelectedActor->GetRootComponent());
}
TransformGizmo = GetGizmoManager()->CreateCustomTransformGizmo(GizmoElements, this);
// creates the gizmo with appropriate interactive elements
TransformGizmo->bSnapToWorldGrid = bSnapToWorldGrid;
if (GizmoElements == ETransformGizmoSubElements::ScaleAllAxes)
{
TransformGizmo->bUseContextCoordinateSystem = false;
TransformGizmo->CurrentCoordinateSystem = EToolContextCoordinateSystem::Local;
}
TransformGizmo->SetActiveTarget(NewTransformProxy, GetGizmoManager());