I have a fully functional RayTracer component that works as it should identifying other components in reach. Now, I need to use something similar but starting in my mouse pointer position (the mouse pointer will be controlled by an eyetracker and I want to manipulate other objects based if the player acknowledged their existence or not).
What I want to know is if I can do this using an On Begin Cursor Over event, mainly if there’s something like a reach variable that I can set (I don’t want any interaction with objects I can barely see that are very far away) Any ideas on the topic?
If your Eytracker uses the Mouse you should be able to use the OnBeginCursorOver event. For the Distance simply do a
float Distance = FVector::Dist(YourLoc,TargetLoc);
if(Distance < 500.0f)
{
//Do Something
}
If that does not Work out for you you can Convert your MouseLocation to WoldSpace and Trace in that Direction by the Distance you want.
Good Luck
Going to try both approaches and see which one works best. Thanks once again!
btw, do you know if there’s a time to count how much time the cursor is over the object? I only want to trigger an event after a certain time
Nope there is none that comes with the Event you have to Set a Timer yourself and On End Overlap you have to Reset and Stop the Timer early so that the Event does not Fire off. (or if the trace hit nothing/other Object than before, in case you do the Trace method)
You actually gave me an idea. When I hit the object, I can set a delay and then check if it’s still hitting the object and then I trigger the event. I’m studying visual attention so this delay will be really small and if it stops hitting the object at any point between that time it doesn’t really matter.