Mouse over events on perspective view

Hi I tried using both Hit results under cursor and convert cursor to world space to select objects under the cursor. This works in ortho view camera.

The problem is in perspective view. Anyone have any good logic to adjust line trace on perspective vision? Thanks for the reply.

This requires no conversion (or are these are 2 separate methods), you get an actor reference straightaway. Share more detail if in doubt. You say objects - are you trying to select more than one at a time, as in an RTS game?

Anyone have any good logic to adjust line trace on perspective vision?

What you’re talking about would work well especially in a non-ortho setup. We definitely need more details.

This is when you mouse over in ortho. The actor BP_doggo gets hit

This when you mouse off in ortho

This is when you mouse over in perspective. BP_doggo is not hit

The actor’s hit box is shifted by an amount depending on the perspective to another location

I was asking how do you offset this amount you shift in perspective if that wasn’t clear

And this also changes for mouse over events when in perspective view for some reason. I don’t know if there is any option I haven’t seen. Basically its like RTS when you select in a perspective.

You do not need to offset anything. This is all that is needed:

If not working as expected, something else is here at play. Custom cursor shenanigans perhaps?


To elaborate, is this the result you’re after:


Screen aspect ratio? Do you, by any chance, change the window size / aspect ratio at any point? Although I’m getting consistent result when shifting things about, too. :expressionless:

This is my graph. Nothing changed except I used camera channel since visibility is ignored

The player actor hit is working since its in the center of camera

Nothing registered when I mouse over dog actor. It shows the hit box

It is working when dog actor is near to the center of screen and hit registered

But as you move your cursor away the hit is still registered at a position that shouldn’t be

I’ve checked if its the problem with custom cursor, it is not. This thing has been driving me nuts for some time. I hope you understand what I am getting at.

Funny thing is that everything works perfectly in ortho mode. I seriously don’t know what’s going on. Please help me Q.Q

Could you test it with much smaller collision boxes? The default trace distance is 100k uus, I’m wondering whether you’re getting accidental hit results when tracing from the camera that is in perspective. This would not exist in ortho.

If i try with smaller hitboxes nothing get registered. I tried trace with vision channel still the same result. Is there any project settings related to this? Something must’ve changed.

By default, the player controller is using this:

image

This would be used if you onClicked the actor. You’re using a slightly different method, tracing on the Camera channel. If the collision volume blocks said channel, a hit will be detected:


Are you, perhaps, using a very large camera distance with very low FOV?

Yeah everything you said is normal. I’m using a simple top down camera with 100 FOV. I don’t know what’s going on

Is there anything special about the doggo’s hierarchy? Root vs Component location? Perhaps you could shed some light here, even if it’s only to eliminate it as an issue.

It’s happening to other objects if the perspective changes. So doggo is not the problem. The problem is that somehow get hit result is not auto adjusting with respect to perspective changes and only working orthogonally.

Is there any settings in project or editor with respect to it?

Could we see the actual script that triggers this?

Is there any settings in project or editor with respect to it?

If there is, I’m unaware of it, sadly.