Skip to content

relativeToProp(...)

Studio is being deprecated, please head over to the documentation page for Mattercraft, our most advanced 3D tool for the web, where you can find the most recent information and tutorials.

relativeToProp(val : number[]) : this;

Sets the array of numbers giving the ratio of contributions that each node specified by relativeTo has on this node’s location.

For more information see:

Default value: [1]

ParameterTypeDescription
valnumber[]The array of numbers to set.

this

myobject.relativeTo([Z.screen, Z.screenRight]);
myobject.relativeToProp([0.5, 0.5]);
// myobject is now located halfway between the center and right of the screen