Script class can't be found

So you cannot use this.context.mainCamera from this object because it’s not a needle engine component - I guess you added the “Camera” parameter to the constructor - where do you call the constructor?

export class MyFlyControlsComponent extends Behaviour {
  awake() {
    this.controls = new MyFlyControls(this.gameObject, this.context.domElement, this.context.mainCamera);
  }
}

^ the code could look like this if you want to create a new instance of this FlyControls type

So I have to do another script file?

by user 883276031048441917

If you want to attach the FlyControls from within Unity then you need to create a component class that extends Behaviour - yes

Needle Engine Scripting | Needle Engine Documentation - please have a look at the docs for scripting

I already read it :smiling_face_with_tear:

by user 883276031048441917

Thanks

by user 883276031048441917