Hi,
I have self-hosted Playcanvas app. Part of the code for creating playcanvas app as follow :
canvas = createCanvas();
devices = createInputDevices(canvas);
app = new pc.Application(canvas, {
elementInput: devices.elementInput,
keyboard: devices.keyboard,
mouse: devices.mouse,
gamepads: devices.gamepads,
touch: devices.touch,
graphicsDeviceOptions: window.CONTEXT_OPTIONS,
assetPrefix: window.ASSET_PREFIX || "",
scriptPrefix: window.SCRIPT_PREFIX || "",
scriptsOrder: window.SCRIPTS || [ ]
});
The scenes are loaded to the app with other script from json file.
How can I loop through all the entities (some boxs) in the app/scene, add “on click” event, change their color?
I want to also to show information when the user click on each box.
The photo below show what I get from console.log(this.app.root):
I am trying to acess graph node “3D” and it’s children shown with red border.