File: UserDataNode.md | Updated: 11/15/2025
A special type of reference node that allows to link values in userData fields to node objects.
Since UserDataNode is extended from ReferenceNode, the node value will automatically be updated when the rotation user data field changes.
sprite.userData.rotation = 1; // stores individual rotation per sprite
const material = new THREE.SpriteNodeMaterial();
material.rotationNode = userData( 'rotation', 'float' );
Constructs a new user data node.
property | The property name that should be referenced by the node.
---|---
inputType | The node data type of the reference.
userData | A reference to the userData object. If not provided, the userData property of the 3D object that uses the node material is evaluated. Default is null.
A reference to the userData object. If not provided, the userData property of the 3D object that uses the node material is evaluated.
Default is null.
Overwritten to make sure ReferenceNode#reference points to the correct userData field.
state | The current state to evaluate.
---|---
Overrides: ReferenceNode#updateReference
Returns: A reference to the userData field.