Hi, I got an problem, i wanna use an raycast from the center off my camera to use it for activate the onclick function have an World Space Canvas Button : Like that the little white red hot in the middle of screen will be an fake cursor and have to remplace the mouse cursor for interact the UI button ( It's for an web app so i can't use the mouse otherwise the cursor will always be out of the screen so i have too hide and lock the real mouse ). I make many research but i found nothing everything i found is totaly out dated ( I use Unity 2019.3 ). Please help me
Hi @Black_Raptor "i wanna use an raycast from the center off my camera to use it for activate the onclick function have an World Space Canvas Button :" Not sure what you are exactly looking for. World space buttons work just as fine as screen space canvas buttons. Buttons should also work with touch IIRC. But if you want to raycast for UI elements, use this and simply replace the mouse position with center of screen: https://docs.unity3d.com/2018.1/Documentation/ScriptReference/UI.GraphicRaycaster.Raycast.html
Thanks you with your help i finally find an temporary way. With that way, the problem is i can't really interact with the button ( Like the color transition the onClick function etc ).