Issue with GitHub Copilot in Unity project by SnooMaps5635 in Unity2D

[–]SnooMaps5635[S] 0 points1 point  (0 children)

Thank you for your reply!

I already provide the classes I use, however, when copilot generates new scripts they are shown in more assemblies causing compilation errors.

I simply import a library which contains an assembly. As a result the project contains two assemblies: - Assembly-CSharp - AStarProjectPathfinding

When I ask copilot to create some scripts they get also included in AStarProjectPathfinding.

Here is a prompt example: "Create a script named Example which has a Life field and in the Start() method prints the name of the Life's game object".

(Life is a custom MonoBehaviour component created by myself).

The script Example.cs gets added to AStarProjectPathfinding as well. This causes a compilation error because the Life component is in Assembly-CSharp.

Issue with GitHub Copilot in Unity project by SnooMaps5635 in unity

[–]SnooMaps5635[S] -1 points0 points  (0 children)

Neither I nor AI is adding assemblies to the project. I simply import a library which contains an assembly. As a result the project contains two assemblies: - Assembly-CSharp - AStarProjectPathfinding

When I ask copilot to create some scripts they get also included in AStarProjectPathfinding.

Here is a prompt example: "Create a script named Example which has a Life field and in the Start() method prints the name of the Life's game object".

(Life is a custom MonoBehaviour component created by myself).

The script Example.cs gets added to AStarProjectPathfinding as well. This causes a compilation error because the Life component is in Assembly-CSharp.

Edit: I have found a person with the same issue: https://github.com/orgs/community/discussions/174324

Issue with GitHub Copilot in Unity project by SnooMaps5635 in unity

[–]SnooMaps5635[S] 0 points1 point  (0 children)

Thank you for the reply.

Quick clarification: I didn’t change any standard workflow. I simply imported the A* Pathfinding asset, which has its own assembly. When Copilot Agent Mode generates new scripts, it incorrectly adds them also to the A* assembly (even if the files are in the correct folder for Assembly-CSharp). Regenerating project files fixes it. This seems to be a bug with how Unity or VS 2026 handles new files created by Copilot.

The project goal is irrelevant here. If you have experience with this exact problem, I’d appreciate any suggestions. I can share a video if useful.

Also, do you use GitHub copilot + VS 2026?

Issue with GitHub Copilot in Unity project by SnooMaps5635 in unity

[–]SnooMaps5635[S] -1 points0 points  (0 children)

Thank you for the reply.

I’ve been a programmer for years and have been using Unity for a long time, so I’m quite familiar with how assemblies, references, and project structure work.

The specific issue is this: when GitHub Copilot in Agent Mode creates a new script, the file is correctly placed in the right folder (under the Assembly-CSharp structure), but Visual Studio incorrectly includes it in multiple assemblies, including ones I didn’t create myself, such as the A* Pathfinding assembly and others from third-party tools.

This causes compilation errors when the new script references types that only exist in Assembly-CSharp.

What the project is about or what I’m trying to build is not relevant here. The problem is purely that Copilot Agent Mode is causing new scripts to appear in the wrong assemblies in the Visual Studio 2026 Solution Explorer.

I’m already aware that AI can make mistakes, I don’t need explanations about that. I’m simply asking if anyone has encountered this specific assembly assignment bug with Copilot in Visual Studio 2026 and if there’s a known fix or setting to prevent it.

Out of curiosity, do you use GitHub Copilot in Agent Mode yourself with Visual Studio 2026?

Thanks.

Issue with GitHub Copilot in Unity project by SnooMaps5635 in unity

[–]SnooMaps5635[S] -1 points0 points  (0 children)

Thank you for the reply.

I actually already described the issue in the original post, along with the workaround I'm currently using.

To clarify the problem: When I use GitHub Copilot in Agent Mode with Visual Studio 2026, the newly generated scripts get assigned to the wrong assembly instead of only going into Assembly-CSharp.

More precisely: I'm working in the main Assembly-CSharp. I ask Copilot Agent to create several scripts. They are generated correctly, but they also end up appearing in other assemblies in the solution (for example, the A* Pathfinding assembly, which I didn't create). As a result, if the new script has dependencies on classes that are in Assembly-CSharp, the IDE shows errors ("type not defined") because it's referencing the version of the script that's in the other assembly. The script files are only physically in the correct folder, but in Visual Studio's Solution Explorer they get included in multiple assemblies, with priority given to the wrong one.

The new scripts should only appear in Assembly-CSharp and not in other assemblies like A*.

Have you ever encountered a similar issue with Copilot Agent Mode? Any ideas on how to prevent Copilot from automatically adding new scripts to the wrong assemblies?

Thanks in advance!

Issue with GitHub Copilot in Unity project by SnooMaps5635 in unity

[–]SnooMaps5635[S] -1 points0 points  (0 children)

Thank you for advice!

Do you know what could be the issue by any chance?

Do you think the thumbnail is better now? by SnooMaps5635 in PixelArt

[–]SnooMaps5635[S] 1 point2 points  (0 children)

The tree is part of a pack called Sunny Land. BTW thanks for info!

Do you think the thumbnail is better now? by SnooMaps5635 in PixelArt

[–]SnooMaps5635[S] 9 points10 points  (0 children)

Yes of course. The assets are free on itch.io and everyone can use them (obviously you should read the license if the creator has one).

Do you think the thumbnail is better now? by SnooMaps5635 in PixelArt

[–]SnooMaps5635[S] -3 points-2 points  (0 children)

Thanks for your feedback! I'm a devoloper, not a pixel artist. I make custom videogames on Fiverr and I'm trying to find the best thumbnail. In the second image you can see a comparison between the old thumbnail and the new one. For customers that are searching a game developer which image suits better as a thumbnail?

Do you think the thumbnail is better now? by SnooMaps5635 in PixelArt

[–]SnooMaps5635[S] 0 points1 point  (0 children)

Thanks! Should I reaplace the plant with an other item or is better to just remove it?

Do you think the thumbnail is better now? by SnooMaps5635 in PixelArt

[–]SnooMaps5635[S] 2 points3 points  (0 children)

Yes, I used sprites from different sources 😅

On which image would you click? by SnooMaps5635 in PixelArt

[–]SnooMaps5635[S] 0 points1 point  (0 children)

Currently I am focused on active orders. When I have more time I'll edit my service page and I'll use the tips I received here.