Picking without colliders #2071
Idomeneas1970
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This has come up many times on discord. I'm relaying some of the posts I made there and Nicogos's on github, so it can be found easier and be discussed if needs be.
This code gets a Ray object based on screen Position. You can use it when you capture mouse clicks like this:
Now if you have a mesh and you know its points you can use this below to get the hit; I use it for my terrain editor, might be slower but it guarantees precise hits:
The corresponding code when you have colliders is below (this is by Nicogo).
Feel free to discuss as needed.
Cheers
Beta Was this translation helpful? Give feedback.
All reactions