visible
Details
Kode wheel segment | Appearance |
Style | Boolean |
Modifiers | None |
Primarily WHEN/DO | Both |
Pre-made brains that use it | Unknown |
Appearance >visible
Description
This tile toggles the visibility of an object but not its attachments. An invisible object does not cast a shadow. The visible property can also be changed in the Brain Properties menu of the object. Objects that are invisible are still attackable and collidable, so you may wish to alter all these attributes in an invisible model so that characters in the world are not affected by them.
Example code
WHEN [once] DO [visible][=][false]
WHEN [visible] DO [power on]
…WHEN [else] DO [power off]
Modifiers
None specific to this tile
Other Uses
Sometimes having the attachments visible while its owner is invisible is a desirable effect – it is often used in the creation of new character models, which only want to use the skeletal structure and sockets of a model, and not the actual model itself. To make an object and all of its attachments invisible at the same time you need the following code
WHEN [once] DO [visible][=][false]
WHEN [for each of][attachments] DO [it][visible][=][false]
Invisible barriers can be made using primitive shapes to stop a character from proceeding into a forbidden area. These can be destroyed at any time to open up these areas.
Visibility can also be used to show weapons on the body when not equipped, or different clothing (made with props) as part of a levelling hero. You place the objects on your hero model and make them invisible until needed. You can also create an evolving character this way, with different versions of the look of the character attached to the base model. You will also need to make the future versions non-collidable.
Making a character invisible can also be useful for getting in and out of vehicles. You create a clone of your character and use an emote to sit them behind the driving wheel, but are invisible when the vehicle is not in use. When the player interacts with the vehicle he is attached and made invisible, while the driver is made visible (and vice versa when they disembark).