Select Objects without Collider?
Used to select an object this way: ///CODE
if(Input.GetMouseButton(0))
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hitInfo;
if(Physics.Raycast(ray,out hitInfo))
{
GameObject gameObj = hitInfo.collider.gameObject;
.....
}
Quesion is: Any Other Way to Select Objects without Collider? Thank you!
Plenty of ways. You could manually calculate the screen position of each object (using WorldToScreenPoint
), then check which of those are near the click.
It's hard to answer this question specifically, unless you can provide more detail about what you're hoping to do.
Calculate the screen position of each object:
What about the object's outline?
detail about what you're hoping to do:
$$anonymous$$y project is to Review a model of a power plant. The Trouble is : it is too detailed and complicated. Adding $$anonymous$$esh Collider to all the sub objects is an ineffective job. And I wonder : How to select objects without adding Collider ?
Thank you !
Just in case someone come looking for this
https://answers.unity.com/questions/50857/clickable-object-without-colliders.html
Your answer
Follow this Question
Related Questions
Check if position is inside a collider 5 Answers
onMouseUp 2D Issues 0 Answers
Rotated object raycasting in wrong directions!!? 3 Answers
No gameobject instance again in update 1 Answer
Ball going through and sticking to flippers in a pinball game 1 Answer