You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I can import three-steer using this repo https://github.com/AlexusBlack/three-steer I've taken the main file with the Entity and SteeringEntity classes and saved in my src.
With some tweaks, I needed to add import * as THREE from 'three';
To the beginning of the file and change module.exports = { Entity, SteeringEntity };
to export { Entity, SteeringEntity };
Then I can import in my main.js using import { SteeringEntity } from './three-steer';
Now I can import it fine, but when I go to implement using let entity = new SteeringEntity(mesh); scene.add(entity);
I get the following error three-steer.js:11 Uncaught (in promise) TypeError: Class constructor Group cannot be invoked without 'new'
The line causing the issue is (in Entity class) THREE.Group.apply(this);
Couldn't find any docs for THREE.Group.apply, is it outdated code? What's the purpose of it?
Would love to update it, I tried this but got another error
const group = new THREE.Group(); group.add(this);
Error Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'remove')
The text was updated successfully, but these errors were encountered:
Hello again
So I can import three-steer using this repo https://github.com/AlexusBlack/three-steer I've taken the main file with the Entity and SteeringEntity classes and saved in my src.
With some tweaks, I needed to add
import * as THREE from 'three';
To the beginning of the file and change
module.exports = { Entity, SteeringEntity };
to
export { Entity, SteeringEntity };
Then I can import in my main.js using
import { SteeringEntity } from './three-steer';
Now I can import it fine, but when I go to implement using
let entity = new SteeringEntity(mesh); scene.add(entity);
I get the following error
three-steer.js:11 Uncaught (in promise) TypeError: Class constructor Group cannot be invoked without 'new'
The line causing the issue is (in Entity class)
THREE.Group.apply(this);
Couldn't find any docs for THREE.Group.apply, is it outdated code? What's the purpose of it?
Would love to update it, I tried this but got another error
const group = new THREE.Group(); group.add(this);
Error
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'remove')
The text was updated successfully, but these errors were encountered: