How to export simply my game view as website

Hi, sorry for this basic question.
I develop a simple infinite runner game for web, I would like to gain massive time by programming it in Unity and export it with Needle.

I had my runner mesh with his script, my static camera is correctly set etc
When I desactivate the export, my game works correctly on my game view on Unity.
But when I export my scene with vite, I can see my scene on my localhost:3000 with orbit control and Autorotate.

But I want this export as my Game view with controls, my static game camera etc.
How could I do that ?

Original Post on Discord

by user 224464722878005248

Hello @AeistDesmos - we currently dont export C# from Unity. So if you have written your Game in Unity you would have to re-implement the logic in Typescript.

You can read about how to do that here: Needle Engine Scripting | Needle Engine Documentation

Ok thanks, I need to create a typescript element, connect it with the unity project to generate the cs and work on cs and typescript in same time I see.

About the camera, how could I manage them to disable the autorotate, choose my static camera as default etc ?

by user 224464722878005248

From your intro I assume you’re using the threejs fiber template? The template has a component currently which you can remove by opening the workspace and then going to “src/App.tsx” in line 17

For now I tried to understand the limit of “only export with unity” to make the game so I was on the simple “getting started” with Minimal template of Needle

by user 224464722878005248

if you are using the Vite template (which we would recommend right now) you can disable or remove the OrbitControls component
unknown.png

Ah ok - great then just remove this component or change its settings and you’re good :slightly_smiling_face:

Ooh

by user 224464722878005248

its on the camera

Okay thanks, you’re great.
More of that, thanks for this marvelous tool, it’s going to revolute the way to create website I’m sure of it.
I’m a junior, full of dream to work on the futur of internet and I’m really happy to discover this type of tool !

A last question : do you work on an automatic export of script cs => ts actually ?

Do you plan to make tutorials ?

by user 224464722878005248

C# to Typescript or wasm would be great. We’ve done some research but it’s not in active development right now

We currently have a getting started tutorial and will add more over time: https://www.youtube.com/watch?v=3dB-d1Jo_Mk :slightly_smiling_face:

Okay you’re great
About camera : It’s static etc, but I ssee deformation between the unity camera and the Vite rendering, I tried to adpt my fov etc etc
Do you know what’s the problem ?

by user 224464722878005248

by user 224464722878005248

by user 224464722878005248

Do you get any errors in the console in your browser?

No, there is not

by user 224464722878005248

Is your camera scaled in Unity?

Great view, it was scaling

by user 224464722878005248

You can’t see it on unity but there is influence on vite

by user 224464722878005248