I’m having a bit of trouble getting the object that overlaps a point (from touch input). I’ve read a few other threads on this topic, but nothing I’ve found has worked.
Currently, I have a setup that works for mouse input. I’ve converted from screen to world position and placed a small collision object under the cursor. The cursor uses enter and exit messages to highlight the latest object under the cursor and save it’s ID. Then on click input I just send a “click” message to the saved ID.
This works, but now I’m testing on mobile and of course there’s no mouse movement to track, just instant taps at a point, so my system fails. I tried doing a raycast on tap, but that doesn’t seem to detect an object if it starts inside the collision shape, and also doesn’t give you results until later.
Is there some way to check for collisions and get a result instantly? Or, if not, some way to defer a function call until the next frame?