Quantcast
Viewing all articles
Browse latest Browse all 99

No renderer.enabled=false on grouped GameObject

Hi everyone, if some of my Gameobjects are grouped in the hierarchy "GameObject.renderer.enabled = false;" is not working. I just want hide some objects if the mouse is over an object. Is there anybody who can explain that to me? Im still a beginner on Unity and in some points I dont understand the software. Here is my code snippet: #pragma strict var group1 : GameObject; var group2 : GameObject; function Start() { group1 = GameObject.Find("GameObjectGroup1"); group2 = GameObject.Find("GameObjectGroup2"); } function OnMouseOver() { group1.renderer.active = false; group2.renderer.active = true; } function OnMouseExit() { group1.renderer.active = true; group2.renderer.active = false; } it would be great if some of you have me some answers. thanks!

Viewing all articles
Browse latest Browse all 99

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>