Need Raycast to interact with World Space Canvas UI

Note: I posted in the wrong forum at first, and so this is me trying this again but on the right forum.

I am making a co-op game where one of the players needs to interact with computer screens. I have a computer monitor with a World Space Canvas on top of the screen, and I have a sprite on top of that that casts a ray towards the computer screen. That sprite acts as the computer’s mouse.

I need a new input module so that the ray can interact with the buttons on the UI, but I am fairly new to Unity and have no idea where to even start. All the tutorials I have looked up include half-baked explanations by YouTubers with extremely thick accents and none of them really explain what they are doing and how I could implement this into my own game. I have been trying to solve this singular problem for months now and I am just about to give up and do something else. ANY help will be extremely appreciated.

you could derive a class form StandardInputModule and override GetMousePointerEventData(int id) there.
As a reference you can see the base implementation of that method here.

1 Like

That’s racist.

I disagree. It is just a fact that YouTubers exist with extremely thick accents.

This could be considered racist:

but only if you understand it in a way that the half baked explanations are provided by YouTubers with extremely thick accents only.

Anyways, the classification of the YouTubers does not add anything to the question, so it indeed is a comment of disrespect.

Yes, so you basically agree with what I said, you just nitpicked the fact that my quote did not include “half-baked explanations by”.

Your last sentence is exactly on point.

1 Like