Sample Project Input Fallthrough Issue

Hey Needle Team/Community!
Super excited finding this engine and excited to explore with it! Would love if someone could assist with the following issue:

Reproducible

  1. Install Needle Engine via .unitypackage (double click)
  2. Follow steps in https://www.youtube.com/watch?v=3dB-d1Jo_Mk
  3. When exporting, switch to React-Three/Fiber instead.
  4. Wait for complete installation, play and test.

User will see the stuttering when trying to drag an object, and the camera rotates as well when its supposed to be stationary.

(works on default vite- however our studio needs reactJS compatibility)
2024-01-16_02-06-05.mp4

Original Post on Discord

by user 884695972863688724

Hello there – we have an experimental AI bot :robot: 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.

Help requested: please wait a moment…

Here is what I found for you :brain: Discord

Hello Kaeya,

It seems you are experiencing issues with the camera rotating when dragging an object, and the object itself stuttering. The problem might be related to the DragControls component, particularly interactions between pointer events and the camera’s transform (see the documentation).

To address the issue where the camera rotates when it’s supposed to be stationary, make sure that any camera controls (like OrbitControls) are disabled or not conflicting with the DragControls during the drag operation. For the stuttering of the dragged object, this could be related to performance issues or conflicts between react-three/fiber’s handling of the render loop and Needle Engine’s expected behavior.

As React and Needle Engine integration can be complex, it might be beneficial to isolate whether the problem is occurring during the drag operation itself or during the camera’s update. Injecting some debug logs or breakpoints could be helpful to understand the flow of events during the dragging process.

If needed, you may refer to the specific section on DragControls to better understand its implementation and events (see the documentation).

Please ensure that react-three/fiber is correctly set up to work with the Needle Engine’s component system. If issues persist, consider reaching out to Needle Engine support or the community for assistance and provide details on the exact setup and issues you’re facing.

1 messages left GPT 4
thread_K2wkBOiLCIuCnc39nz6HvfbE

Hi, the camera rotation happens because the react sample uses the R3F camera + OrbitControls instead of the Needle Engine component so the DragControls can not disable the Orbiting while you drag (right now) - you can change that in the project.

If your studio just needs React and not React Three Fiber you could also use our React template - to avoid this confusion. would that help?

I’m trying React to see if it has same issue rn! Thanks for the quick response

by user 884695972863688724

Ok sure - it wont have that :slightly_smiling_face: because there’s no conflicing behaviour with the R3F components. We should update the R3F sample @herbst​:cactus:

Any recommendations from your end on whether to use R3F or R3 if we’re going to overhaul the 3D portion anyway? :stuck_out_tongue_winking_eye:

by user 884695972863688724

We’re Unity devs so our attempts at transitioning to R3F was a pain in the :baby:

by user 884695972863688724

I’d recommend to use “normal” react without r3f

You dont need r3f here - avoid the confusion and just build with Needle Engine - if your project requires react for building the UI then you can use the react starter project and you’re good :slightly_smiling_face:

Yeah react works lovely

by user 884695972863688724

Love the seamless workflow and quickstart so far- we’re going to be so much more comfortable building in Unity

by user 884695972863688724

Just need to do some mobile profiling and performance comparisons etc…

by user 884695972863688724

Fingers crossed Needle will be our go-to!

by user 884695972863688724

Sure, let us know if you got any feedback or have more questions

Thanks! :fire:

by user 884695972863688724

Yeah, let us know how it goes! So far we have outperformed any other web framework in performance tests / technical due diligence, including Unity WebGL and R3F :wink:
Out-of-the-box asset optimization and progressive textures are hard to beat! :slightly_smiling_face: