Download

Mouse over events blocked by invisible walls (4.12.5)

Greetings.

I would like to know if someone else is experiencing this.

I have a mouse over event on my game to show interactive objects from level:

27af3730626c493384ce210a38d4560dbc2b624b.jpeg

Work wonders on editor…

But on running the game the event generated by the player controller (on TickInput() method I guess) is being blocked by primitives flagged as InvisibleWalls…

dbce2cac27c50c9c9bd86c2a85e90d771489fcb6.jpeg

Here is the blocker…

54bdf25f625602cf736ec327514cd73a0301093a.jpeg

The main issue is the TickInput method being declared PROTECTED and not virtual on PlayerController.h so, I don’t have any way to try to mess with or fix this without going custom build.

Is there another way to make the mouse over event “fail-proof” use the visibility channel to trigger?

Thanks.

Solving the problem

Hi guys, thanks to the ones that at least checked my question, here is one solution:

b46ac133106f5be33599299b03f610d132121ac3.jpeg

SOLUTION:

As I suspected, the mouseover events are triggered by the protected TickPlayerInput() method, to “redirect” this call you will need DON’T call Super::PlayerTick, since PlayerController::PlayerTick is where the protected method is originally called, so you can override PlayerTick copying and pasting all the content but the TickPlayerInput() call into your new one (as you know, PlayerTick is virtual).

Now on a new TickPlayerInput() change the way you get the Hit result…
…from: *GetHitResultAtScreenPosition(MousePosition, CurrentClickTraceChannel, true, /out/ HitResult) *
…to: GetHitResultUnderCursor(ECC_Visibility, false, HitResult)

I guess this will also make all the Viewport stuff from the original method useless, so I tossed it out (no problems detected until now);

The cool thing is that by also overriding the result from CurrentClickablePrimitive at the end of the method this also solved the click events dispatching trouble (also being blocked).

We’ll be back soon with more hacks if need. LOL

Best Regards!