It works OK, but I couldn’t find another way to extract the gameobject from a UI Pointer event.
This flowchart is attached to an empty gameobject and (among other stuff) highlights whatever object is clicked by assigning a different material.
There is an included Event that you can use for this, called “Mouse Pick” and found under “Events/Input” subcategory.
The Flow output is called whenever the player clicks the mouse on some collider in the scene (you can also set a LayerMask in the node’s inspector) and the Pick Info output is a RaycastHit type containing the info.
BTW, i believe i found a bug in Debug.DrawLine and Debug.DrawRay
I couldn’t get them to draw lines/rays in the editor, while doing it through a C# script works fine. There’s a chance I might be doing something wrong, but I thought I’d let you know.
If you are using a Debug.DrawLine version that takes a color parameter, just make sure that you set the color alpha, which by default is 0 (invisible) when the node is created 🙂
If you are using a Debug.DrawLine version that takes a color parameter, just make sure that you set the color alpha, which by default is 0 (invisible) when the node is created ?
Let me know if that was indeed the case.
I can’t thank you enough! Yes, that was the case and in fact it was the same reason i couldn’t change group colors too! (I’d never thought a color picker would default to alpha = 0)
Author
Posts
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic.
Login
Register
By registering on this website you agree to our Privacy Policy.