Hello there – we have an experimental AI bot that might be able to help you with your question. Would you like to try this out?
How it works:
Reply to the messages of the bot that end with a thread_id to interact with it and ask follow-up questions. You can also mention the bot directly in this channel to get help.
Hi Aya Ali, I understand you’re trying to customize FlyControls by extending it from EventDispatcher to deactivate the default control and add your own to the camera. However, it seems that FlyControls in Needle Engine is already a class that extends from Behaviour, which means it comes with its own lifecycle methods and ways of interacting with the engine.
Please make sure that you are defining your custom controls in conformance with how Needle Engine expects components to be built. This usually involves extending from Behaviour and implementing the relevant lifecycle methods such as update. Custom controls should ideally be built by composing these behaviors rather than directly modifying core components like FlyControls, which might lead to compatibility issues.
If you are still experiencing an error and it’s related to how you’re trying to extend or implement FlyControls, it could be helpful for you to share a snippet of the code where you are encountering the error so I can provide more targeted guidance.
Additionally, regarding the solutions from Stack Overflow that you tried, it’s important to ensure that you have the correct imports and that your class name matches the file name if you are in a Unity context, since Unity links scripts to game objects using the filename. If you are in the Needle Engine context, make sure to follow Needle Engine’s own conventions for extending and implementing component classes.
1 messages leftGPT 4 thread_edUqRb4gYN7pKFHXNEauU5it Thanks for your feedback!
It’s basically a copy from FlyControls.ts that ships with Needle Engine but adjusted so that you can adjust movement speed and roll speed (set it to 0 to disable the movement in the directions you mentionde)