I load three objects in a scene with a gltf loader (3 birds), when I try to get one of them (using the GetObjectById method(ByName doesen’t work)), I get one object that contains all those three birds.
I tried to get a child from this object, but it doesn’t work.
The question is-how can I get a separate model of one bird?
I need this to change their location in the update method (to do something similar to flying).
Code:
const parrotPosition = new THREE.Vector3( 0, 0, 2.5 );
loader.load( ‘models/Parrot.glb’, gltf => onLoad( gltf, parrotPosition ), onProgress, onError );
const flamingoPosition = new THREE.Vector3( 7.5, 0, -10 );
loader.load( ‘models/Flamingo.glb’, gltf => onLoad( gltf, flamingoPosition ), onProgress, onError );
const storkPosition = new THREE.Vector3( 0, -2.5, -10 );
loader2.load( ‘models/Stork.glb’, gltf => onLoad( gltf, storkPosition ), onProgress, onError );