hi, I’ve been working on a C++ project for the past six months or so (it uses some blueprints as object templates, but 100% of the logic uses C++)
The first three months were focused on “how it works”/logic, and the past three months I spent working on “how it looks”/UI. Last night I was finally ready to merge the ‘how it looks’ with the ‘how it works’, when I noticed that the mouse events when interacting with the 3-D world are not working anymore.
The mouse events UI related seem to be working fine. At first I thought that I may have forgotten to set the root of my various UI components to HitTestInvisible.
I checked each UI component very carefully, I even tried to hide them all and eventually I even removed all of them from viewport, but the mouse events in the world were still not working. I even tried to force the input mode to game only UWidgetBlueprintLibrary::SetInputMode_GameOnly(this);
but to no avail…
For example, hover over 3-D objects was supposed to enable stencil, or clicking the left mouse button was supposed to make the character move, which used to work just fine before shifting my focus on UI few months ago.
As it happens, the UI design approach was meant to be pretty sophisticated, and it took a while to put it all together, during which I didn’t need to keep an eye on the “how it works” side of the project.
I hope that my assumption that completely removing any UI from the viewport would make the above work again, as they haven’t been touched at all in the past few months, is correct.
For example, the default function MoveToMouseCursor generated when the project was created from the top down template was working just fine three months ago, but now nothing happens
FHitResult Hit;
GetHitResultUnderCursor(ECC_Visibility, false, Hit);
if (Hit.bBlockingHit)
{
// We hit something, move there
SetNewMoveDestination(Hit.ImpactPoint);
}
or, the stencil related function, BeginCursorOver(UPrimitiveComponent* HitComp)
used to work three months ago, but not anymore, no breakpoint is being triggered anymore during troubleshooting.
I do not get any error messages, nor warnings, everything compiles fine, is just the mouse not interacting properly with the world, the UI events appear to be working fine though.
Please let me know.
Thanks!