PropGhost

A see-through preview of one or more prop meshes that only one player sees, useful for showing where something will be built. It is not a prop: it has no collision, and it ends at the player's next level load or when they leave. Client scripts can draw their own with PropGhost.create(options), with no player and nothing sent to anyone.

propGhost.create()

PropGhost.create(player, options = {})

Shows a preview to a player in the world. A player can have up to 32.

propGhost.all()

PropGhost.all(player)

All previews, or one player's.

propGhost.destroyAll()

PropGhost.destroyAll(player)

Removes all previews, or one player's.

propGhost.id

id

The preview's number.

propGhost.player

player

The player who sees it.

propGhost.valid

valid

Whether the preview still exists.

propGhost.model

model

Its first mesh.

propGhost.position

position

Its location.

propGhost.rotation

rotation

Its rotation.

propGhost.scale

scale

Its size: a number, or a Vector3 if scaled per axis.

propGhost.hidden

hidden

Whether it is hidden.

propGhost.setPose()

setPose(position, rotation, scale)

Moves, turns or resizes it, leaving out values unchanged.

propGhost.setTint()

setTint(tint)

Changes the colour. null uses the meshes' materials.

propGhost.setValid()

setValid(valid)

Shows the valid or invalid tint it was created with.

propGhost.setHidden()

setHidden(hidden)

Hides or shows the preview without removing it.

propGhost.destroy()

destroy()

Removes the preview.

propGhost.getBounds()

getBounds()

Client only. The box its meshes occupy in the world, as { min, max }, as the game last measured it, a frame after it stands or moves. Null before its meshes stand, while hidden, and once destroyed. Always null on the server.