how to get screen mouse XY axis into 3d world axis?

hi,
I need do one very common function in 3d gaming, user click the mouse on the screen the I need to get the ray collision from the 2d xy to the 3d world, can anyone kindly tell me how to implement this in Unity3D?

-daqula

Camera.ScreenToWorldPoint
Camera.ScreenPointToRay

Take your pick based on the best fit for your needs. :slight_smile:

hi,
got it, thanks man:)
here I get new one question, would you also kindly help me?
the question is, I found, Move in charactercontroller, is ther any function does like “Moveto” actions? Like I give one point where the character should go to, then just let it go without any manually controlling.

-daqula

You’re welcome, I’m here to help. :slight_smile:

FYI, it is bad form to post separate/new questions in an existing thread as that leaves the Q&A “hidden” under an incorrect title. Please post new questions in a new thread, thanks.

As far as I know it’s not in there by default but you could certainly add that if you’d like.