Is there any react template?

Hi! im new with this tool and i would like to know if i can use this with my react website.

I need to add some 3D environments and 3D minigames to my site but i need to know if this tool works for this and if there is any react template.

thanks so much!!!

Original Post on Discord

by user 489437986187116545

i have the unity project but when i open it i see it into the explorer. what i need is to add the unity game to my react app

by user 489437986187116545

Hi, when you create a new web project you’ll find a React template that you can select and use as a sample
image.png

oh okay, but for example if i have some logic into unity (like when mouse is over an item) i can play with that logic on the website?

by user 489437986187116545

oh thanks so much!!

by user 489437986187116545

but when if i write c# logic into the unity project it is not working on react

by user 489437986187116545

im using on mouse enter events

by user 489437986187116545

Hi, happy to hear you’re making progress. You need to write your logic in Typescript or Javascript, not C#. Please read more in the docs Needle Engine Scripting | Needle Engine Documentation

ooh okay

by user 489437986187116545

thanks

by user 489437986187116545

and i have this situation. i have my react template created. i want to add the unity game into a canvas of my template

by user 489437986187116545

You can take a look at how the react template does that - basically you can connect your Unity project to your existing react template, import + add needle-engine similar to what the sample does

so, i can create the game and add it into a react modal for example?

by user 489437986187116545

Exactly!

and can i connect unity with my code to do somehting like

  • when the player picks an item into the game, then i call a react function and i save some information into my database

by user 489437986187116545

Yes - you can call methods in your Needle Engine project / components from react (or call react from your Needle Engine components) to do that (you can do exactly the same things you can do when building any website!)

All that is easier than with Unity’s webgl actually because a “Needle Engine” project is your react project and can be added to any modern web project :slightly_smiling_face:

great! do you have some video tutorial?

by user 489437986187116545

Yes, see https://www.youtube.com/@needle-tools

i saw that channel, but do you have some video where connect unity with the react app?

by user 489437986187116545