Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Anyone know how to use Unity3D here?


ECLIPSc70

Recommended Posts

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

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...