Help fixing project - lost reference to scripts and web project

At some point I tried setting up git and thought it would make sense to have the Needle web-project folder in the same folder as the Unity Project (as oppose to having the web project folder within the Unity Project folder, which is the default - I think?)

I’ve come back to the Unity project and I’ve opened the particular web-project in the Needle Engine Unity component. I can start the server and I get normal behaviour. However, the Unity generated stub components are messed up.

Is there a way of regenerating the components or something like that?

Thinking :cowboy_hat_face:

Additional images:

The web project is in the Unity project for most of the samples since they all have use the same template without changes - so they don’t need to be added to git.

Moving the web project to another folder makes sense and is necessary for git since you should not include Unity’s Library folder in git. No problem here.

Have you maybe forgotten to update the web project path in the Needle Engine project? The C# stub components live inside a Unity Assets folder (Assets/Needle/…) and unless you deleted them they should still be there and well.

Yup, the code gen components are there in that folder.

I did update the project path in the Needle Engine component

I think I’ve lost control of what’s going on now - the Needle server loads but now doesn’t give correct behaviour anymore - the scripts don’t seem to load. I’m not sure what’s changed.

Not getting any errors in Unity other than these:

When I go to re-add the stub component onto the game object I get this:

Which Unity version are you using here? The compiler error is happening in UnityGLTF.

In additon I tried to reselect the path for the codegen compiler, thinking that it was targeting the previous projec folder. I reverted it back to what it was targeting before but I got this warning on both times:

No it’s not related to this. It’s an issue in UnityGLTF. Can you try opening the Window/PackageManager and downgrading UnityGLTF to 2.18.5 ?

2022.3.10f1

Ok your Unity version is also very old.

The best approach for the future is to upgrade Unity to a more recent 2022.3 version (currently we’re 2022.3.62). (recommendet)

I think it might be best to rebuild the Unity Project from scratch with the latest version.
Somewhere along the lines I feel like I messed something up with Git, maybe I didn’t track the src/scripts folder…

Is there a recommended Git practice for Needle Projects that I can reference?

Can’t seem to install 2.15

You just need to use Unity Hub to install the latest 2022.3 Unity Editor and then use it to open your current project. Then you’re done!

Hi, did you try upgrading Unity?

Regarding git:
The web template comes with a gitignore file that is setup for most web projects to ignore e.g. the node_modules folder. Best practices are the same as for any Unity project besides that (ignore Library, obj and Temp folders and so on) - maybe this page helps to understand it better.

Yes, upgraded to 2022.3 and we’re back to normal :slight_smile:

1 Like

This topic was automatically closed 13 days after the last reply. New replies are no longer allowed.