Do I have to modify engine code to realise a custom ICameraController?

I want to switch camera control mode between FlyControl and OrbitControl.Currently there is only OrbitControl in engine component.In my circumstances, there will be complex scenes to inspect so FlyControl will be needed.

I found the Third Person Controller Sample project and indeed by adding custom fly control component is sufficient to solve this problem.But it needs my users to add the FlyControl component manually, and i have to push a fly control package to npm to let user to define a npmdef link to it.So It is not ideal to implement a custom component.

I’d like to find a way to add default flycontrol just like the property camera-control.Do I have to modify the engine code?Or is there a way to work around?

Thanks for help!

I’m sorry, I couldn’t find a response but notified the team :robot:

Hi, you can simply put your custom component in your web project src/scripts folder. No need to push anything to NPM.

Please check out docs for custom scripting: Creating and using Components | Needle Engine Documentation

Oh!My web project is not the generated project from unity, actually I tried this before but I didn’t migrate the gen.js and register_types.ts to my project, so it says cant find my FlyControlComponent:

globalThis["needle:dependencies:ready"] = import("./register_types.ts")

It works fine now.

My project uses needle engine as a bridge between unity scene and web element and my users should use unity to export the scene and then put the assets folder to my web element to render.So i guess they still need to link the npm to get custom components and mount it on the scene and then export.

Thank you! You’ve been really inspring to me.

Can you not add the FlyControls via code using your built web project?

If i understand you correct you build a website where people can drop their scenes that they exported from Unity using Needle and then fly through the models, right?

Yes.My web project is designed to generate unity scenes and models automatically as user’s requirement describes. So I use needle engine as a way to show the outputs. Users might want to fly through the scene to inspect some details though it should be enough using orbit control in most cases.

This topic was automatically closed 13 days after the last reply. New replies are no longer allowed.