Skip to reading
GDScript Programming & Godot

IfPlayerWasHere()

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page
On this page
Code example
IfPlayerWasHere(scene_id: String) -> bool

Compatibility query for the current player’s room visit history.

Returns: Boolean.

Code example
IfPlayerWasHere("lab")

IfPlayerWasNeverHere()#

Code example
IfPlayerWasNeverHere(scene_id: String) -> bool

Complement of the player-visit query.

Returns: Boolean.

Code example
IfPlayerWasNeverHere("lab")

IfVariable()#

Code example
IfVariable(variable_id: String, expected_value: Variant = true) -> bool

Compare a runtime game variable with an expected value.

Returns: Boolean.

Code example
IfVariable("powered", true)

This does not read a same-named local/member variable.

IfInventoryItemWasUsed()#

Code example
IfInventoryItemWasUsed(item_id: String) -> bool

Check the inventory item supplied by the current interaction context.

Returns: Boolean.

Code example
IfInventoryItemWasUsed("key")

A direct Run can have no item context. Possession is a separate query.

Page 76 of 378Permalink
Go to page