Mouse Interaction

Scenario: Room with a door, click the door to open it. Change cursor hand to let user know door is clickable. All of this works.
I use begin and end overlap to change the cursor.
I use clicked to open/close door.
I have distance to object to prevent the user being able to click on it from other side of room.
However the issue is how to use a distance with begin and end overlap for the cursor change? Begin and overlap only fire once, so if I check distance when they fire, then the cursor would never change, if they walked directly towards door and cursor never moved from door.
I was curious as to how overs deal with this issue.Hope the scenario makes sense.

hi @Max20192011

What you could do is on begin and end overlap, set a bool value say “bDoorOverlap” and nothing else, true on begin, false on end.

then in event tick check the distance to the door using a compare, if less than or equal than the maximum range then change the mouse to the correct pointer if bDoorOverlap is true. If its above change it back regardless (dont check bDoorOverlap because it dont matter you are too far!)