ECLIPSc70 Posted January 8, 2012 Report Share Posted January 8, 2012 I'm in need of major assistance. I recently converted from GM to Unity and everything is pretty different. I learned the basics the other day but I'm trying to make it so that at the press of a button I can toggle the solidity and visibility of an object. Help would be greatly appreciated. Link to comment Share on other sites More sharing options...
Damizean Posted January 10, 2012 Report Share Posted January 10, 2012 public void ToggleVisibility() { if (this.renderer) this.renderer.enabled = !this.renderer.enabled; } public void ToggleRigidbodySolidity() { if (this.rigidbody) this.rigidbody.detectCollisions = !this.rigidbody.detectCollisions; } public void ToggleColliderSolidity() { if (this.collider) this.collider.enabled = !this.collider.enabled; } Link to comment Share on other sites More sharing options...
ECLIPSc70 Posted January 11, 2012 Author Report Share Posted January 11, 2012 Awesome! thanks Damizean Link to comment Share on other sites More sharing options...
Recommended Posts