How is convertToWorldSpaceAR used?
Cocos
AUGUST 26, 2024
Create the following class, create an empty node, attach it and run it import { _decorator, Component, log, Node, Vec3 } from 'cc'; const { ccclass, property } = _decorator; @ccclass('NewComponent') export class NewComponent extends Component { update(deltaTime: number) { log(this.node.name); const worldPosition = this.node.convertToWorldSpaceAR(Vec3.ZERO); log(worldPosition); } } It runs fine until “log(this.node.name);”, but in the next line I get the following error [Pre.
40
40
Let's personalize your content