I have a few questions about Needle

hello! Thanks for making such a great tool.
I’ve been watching the tutorial, but I’m still not sure about Needle, so I have a few questions.

  1. Is this a tool that converts Unity projects into Three.js and exports them to the web?
  2. Is it possible to mix and use C# code like an existing Unity project?
  3. When I saw the tutorial, I could see the other person’s point of view (camera) through the network. Is it possible to implement multiplayer (displayed as a character) using this?

Original Post on Discord

by user 745912722356699257

Hi,

  1. This depends on what features you are using. If you use timeline and animators for example then yes, it will work on the web. What will not work out of the box is any custom C# code. That you will have to convert to typscript (we have some helpers and convertion tools for a quick start but you’ll have to write a little bit of typescript probably) Feature Overview | Needle Engine Documentation
  2. Yes you can mixmatch, you can have a project that still works as a normal standalone unity app (for whatever platform) and at the same time export to threejs (see answer to 1)) Deployment & Compression | Needle Engine Documentation
  3. We have builtin networking and it’s possible to use your own networking backend or another solution if you need to.
    It’s possible yes, Felix did a little demo/presentation here a while ago: https://www.youtube.com/watch?v=joQJH-mmEII&ab_channel=Webaverse

Thank you for answer! However, after watching the video you sent, I’m still struggling with implementing multiplayer.

  1. First of all, I was practicing with the ‘third character controller’ that exists in the sample scene.
  2. Added ‘PlayerState’ to the Character component.
  3. I also added an ‘Empty’ named ‘player’ to the scene and added a ‘PlayerSync’ component. The parameter ‘Asset’ is specified as Character.

by user 745912722356699257

by user 745912722356699257

But I’m having a ‘character disappearing’ problem like this video, and I haven’t solved it yet.

by user 745912722356699257

Can you try changing your character to a Prefab and then assigning the Prefab to PlayerSync?
image.png

I’ll try it. Thanks you so much.wait a minute!

by user 745912722356699257

Did I do it right? Why is the character being duplicated? :disappointed_relieved:

by user 745912722356699257

It looks like he is in your scene twice (on time in the scene and one time instantiated by PlayerSync)
image.png

You dont need the prefab in the scene. Just referencing the prefab asset from PlayerSync should do it

Thanks! I deleted the prefab in the scene and I only referenced the prefab asset from PlayerSync, but it doesn’t work yet…

by user 745912722356699257

At this video, the character is not visible in the scene…:PandaSad:
bandicam_2023-05-02_03-20-39-603.mp4

by user 745912722356699257

Does the scene have a SyncedRoom component? It looks like you are not connected to any networking backend?

Can you check the console log in the browser if it contains info if you have a connection or not (you dont need the “Networking” component unless you want to change which backend it connects to, only SyncedRoom is necessary, it has settings to make the connection)

Yes! The scene have a SyncedRoom component!

by user 745912722356699257

and here’s my browser’s console log!
I configured the networking component in the same way as in the ‘sandbox’ example, what is the problem?:TrippyBlob:


image.png

by user 745912722356699257

Does anything change when you open a second browser window to the exact same url?

Maybe its because of the room name and something not working there? Altough the logs look correct but just for testing maybe you can enter “test” in the SyncedRoom component?

If you dont find a solution please send a bug report using the menu item in Needle Engine/Report a Bug. Im not at the pc anymore today but can try to look at it tomorrow

Which version are you currently using? (It tells you in the footer of the ExportInfo component)