Skip to reading
GDScript Programming & Godot

IsValid()

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
Code example
IsValid(value: Variant) -> bool

Check non-nullness, and use is_instance_valid for Object values.

Returns: Boolean.

Code example
IsValid(0)

A valid record-proxy object can still refer to a missing record. Use proxy.Exists to check the record itself.

TypeOf()#

Code example
TypeOf(value: Variant) -> String

Return PCA-friendly type text for a native value.

Returns: String such as integer, number, array, vector3 or object.

Code example
TypeOf([1, 2])

A PCAScriptRecordProxy is an Object, so it is normally reported as object. This differs from the PCA Script VM’s record value type.

Page 87 of 378Permalink
Go to page