Source:setPosition

Edit

Sets the position of the Source. Setting the position will cause the Source to be distorted and attenuated based on its position relative to the listener.

Only mono sources can be positioned. Setting the position of a stereo Source will cause an error.



Set the position using numbers.

Arguments

NameTypeDescription
xnumber The x coordinate of the position.
ynumber The y coordinate of the position.
znumber The z coordinate of the position.

Returns

Nothing

Set the position using a vector.

Arguments

NameTypeDescription
positionVec3 The position.

Returns

Nothing

Notes

The position doesn't have any defined units, but meters are used by convention.

See also