Hi everyone. I have made several games using Unity. I’m mainly a programmer, but have started to dive into the world of AI generated code. Since i know how to program i understand the value of getting AI to generate code for you, since i am able to read it and understand it before i implement it. I have started using Claude Code inside unity using the MCP. Right now i’m a bit scared of using it like how i see many people use it (creating entire things such as adding a script to a GameObject, adding a rigidbody, collider, setting references, creating some UI, creating a manager for that UI, setting up the references between the UI and the manager etc). A lot of the videoes I see sorrounding it, it seems like it can easily make a mistake of set up / modify something i would not be aware of. Setting up a GameObject with a rigidbody and a collider of creating some Text and placing it on the bottom of the screen, changing the text size etc seems very trivial, easy and quick to do. As i said before, i can really see the value of getting it to quickly generate a script for me (even boilerplate scripts such as a health system, some basic movement etc) or more advanced things such as a slingshot mechanic from Angry Birds. Getting it to generate this either in a browser (where i can copy and paste it into Unity after reading it through) or getting Claude Code to generate it inside of Unity seems fine, since i’m not asking it to do specific things inside Unity while also making some code. What are your guys thoughts on this? I kind of like the idea that i know how i’ve structured a GameObject with components or setting up the references to be sure it selected the correct one, pasting in the code myself and making sure everything is connected correctly (because then i know how everything is interconnected). I’m really interested if i’m the only one that thinks like this (seeing the value of generating code, but not so much it doing so many things inside of Unity that i myself could pretty easily do while maintaining control and overview of the project and the structure of the project). I don’t want to fall behind or sound like someone who is not willing to learn new ways of working effectively, i am genuinely just very curious to hear other devs experiences etc.
Cool… let us know, some of us haven’t figured that out after years and years of using chatbot tech.
Code is worthless. Typing code fast is even more worthless. Code is written for the sole purpose of transforming data, no other reason at all. If it fails that test, it doesn’t matter how fast it was written or who wrote it.
It may help you to stop calling it “artificial intelligence” because there is no “intelligence.” It’s a probabilistic word guesser, also known as a chatbot.
Well for a lot of people it can help if you are stuck on a problem etc. My main question was still regarding using Claude Code or another tool with an MCP in Unity. Have you tried it out and do you see the value?
Then by all means use chatbots.
Yes. And no, certainly not for actual learning.
For doing, perhaps. Learning? No.
All of this chatbot tech is massively subsidized and that is starting to end, which is going to change the entire value proposition when using a subscription starts to cost more. You’re already seeing it with the end of “tokenmaxxing”
Frankly, you don’t need MCP if you’re just using Claude Code for writing actual code. If you want to make custom skills to generate scenes, objects, meshes, prefabs, etc, then you may want MCP to hook into that stuff but otherwise you only really need Claude Code in PowerShell. You should start with code and scale up as you need more automation. AI is a tool and you should use it as such, but you don’t need everything right up front.
Calling it a chatbot and downplaying it’s value is very naive. It’s not going to go away, so get on the train.
It is a chatbot.
I’m not downplaying anything. We’ve all been using these things long enough to develop a sense of what they can and cannot do, as well as what implications their use has on the person using them.
Good lord, who said they’re going away?!
I pointed out:
Can we agree that we’re in a massively-subsidized situation right now?
Can we agree that a coding assistant for $20/month is quite different than $2000/month?
If not then we can simply part ways and disagree.
I use AI a lot, both free (Gemini) and paid within Rider (Junie, using either Claude or Gemini). I only glanced at Unity AI Assistant and stopped using it quickly.
The main takeaway is: use AI from within your IDE. In Rider and with Junie, it knows your project, reads and modifies your code, while Rider understands Unity (unlike Visual Studio/Code). I have not used AI to modify anything but code and USS/UXML assets.
AI as a “chatbot” is great when the output is actual text. But getting AI to perform the UI tasks or even create a scene that looks the part is next to impossible. Everything I’ve seen is gimmicks, not actually productive helpers. When you need those, you’d have AI generate a script that implements said helper such as a prefab painter tool, or a randomize objects on grid script.
To think that some abuse AI just in order to add a component to an object and prefill the Inspector values and assigning references is madness. That’s super inefficient, you can do that setup faster than writing the prompt, let alone waiting for AI to apply the final result.
In other words, stick to using AI for what it’s great at: modifying source code. And this includes structured text of any kind be it .xml .css .uss .uxml .asmdef .json .ini and so on.
Can a chatbot modify multiple scripts in a project so that multiple related fields in several scripts are properly refactored out into their own DTO class, and properly referenced by or passed along so that the code remains in a working state? While also building the project, detecting a syntactical mistake, and correcting that. And that really is just an everyday-use example.
So no, an IDE integrated AI used to assist in programming isn’t just a chatbot like the support assistants on corporate websites.
However, the Gemini we get to use on Google’s page is a chatbot. It cannot be trusted with anything. It will output a broken script. You tell it that it made a mistake. It admits to having made a mistake and gives you the corrected code. Except that corrected code is the same. It will also frequently fail at providing facts, or contradict itself within a single sentence, and applaud you on every prompt how “excellent” your thinking is. That Gemini is free, and that apparently has to be subsidized by dumbing it way down while making the user feel smarter.
So there’s multiple sides to this story. ![]()
And yes, AI is currently heavily subsidized. I lean into it for as long as that is the case. Because beyond that, you will have to have that experience in order to know when the use of AI is justified, and how to prompt it cost effectively. I’m almost seeing it a few years where job applications have a requirement like “ability to prompt AI cost effective”.
I use Codex in the IDE not within Unity. I know it can’t “think” but I still treat it like it can. I had a sticky problem upgrading an old project from 2022.3 to 6000.3 using AR Foundation. That thing changes constantly and the upgrade left missing scripts on the AR Session. In the past, I just gave up and left it on the old version because it would require me to have two projects open in different editors to track down what changed. This time, I opened the folder in Codex and asked:
“How familiar are you with Unity and Unity AR Foundation projects? In particular, I need to upgrade from Unity 2022.3 to Unity 6000.3 and some of the interaction scripts have changed so there are missing scripts on the AR Session object.”
Anyway, it’s very polite and said “Pretty familiar. I can help with Unity projects, AR Foundation, XR Interaction Toolkit, package/version migrations, missing MonoBehaviours, prefab/script GUID breakage, and API changes.”
Anyway, start with something simple, if it breaks revert the project. First I had it migrate URP to RenderGraph (another PITA I hate doing). It worked. Then it found the missing script, using GUID data, atc. and fixed up my prefabs to the new AR Foundation workflow.
In the discussion, I mentioned how brittle the project was, packages outside package manager, etc. and it focused pretty ‘surgically’ on only those areas it needed to work on. So, project upgrade worked and huge headache for me went away. Generally, I ‘trust it’ to do things, but always have the ability to revert back if it breaks something.
Right now im mainly using the default IDE with Unity - Visual Studio Community. I know that with Claude Code i would need to use something like Visual Studio Code. I tried it out quickly while also integrating the MCP and didn’t like the workflow that much.
Right now im just using the Claude.ai chatbot for code, but i guess having it in the IDE so it knows your scripts is a lot more useful. I’m still very “new” to using AI directly with code since i was just used to writing all the code myself.
What IDE do you use?
I use Rider. But, I misspoke, I don’t use Codex inside of Rider, I use the Codex app. It’s a bit of a strange app, it expects that you open the root folder, like an IDE, otherwise it will start a new project for you. It also can use git, so it’s kindof scary at first. I don’t allow it to do things without asking and I still commit to git myself but I’m pretty sure it could push to git as well.
It’s night and day between an online chatbot session. It can look at the entire project, for my AR problem Codex found the two scenes where the issue was without me telling it where to look and fixed them both.
As the technology currently stands, it is a prime example of the Pareto Principle: Pareto principle - Wikipedia
In short, the principle states that there is a 20% of the work that can produce 80% of the results. In traditional game development, there is no reliable way to know in advance which 20% of actions will produce that outcome. Experience may improve your chances of selecting the right actions, but ultimately you want software that works correctly 100% of the time, not just 80%
LLMs have access to enormous amounts of data and are exceptionally good at pattern recognition, which allows them to produce that initial 80% of the result. This is where the problem begins: when someone sees 80% of the result produced after only a few prompts, they may believe they are almost finished, when in reality only 20% of the work has been completed.
This can lead down several paths. Someone might continue prompting, hoping they can eventually provide the right prompts to generate the remaining 20% of the result. Unfortunately, that remaining 20% of the result represents 80% of the actual work: handling edge cases, fixing subtle bugs, refactoring, debugging, optimizing performance, and addressing countless other details that LLMs currently struggle with.
Alternatively, they may decide to complete the remaining 20% themselves. This is also problematic because they still have to perform 80% of the work while also paying the comprehension debt required to understand what the LLM has already produced. In many cases, that 80% plus the comprehension debt exceeds the effort that would have been required to do 100% of the work from the start.
When it comes to working within Unity, not much changes. The main difference is that the missing or incorrect 20% of the result is usually very easy to identify because the errors most of the time are either logged in the Console or appear visually in a way that is immediately obvious. In code, however, these issues are often much harder to spot. Only compile time errors are immediately apparent, while logical runtime errors are typically discovered only after extensive testing. Those runtime issues make up the remaining 20% of the result, which often represents 80% of the actual work.
My view is that, both in code and within Unity itself, LLMs should be used when 80% of the result is good enough. This excludes production projects, but they are still useful in many situations where achieving 100% correctness is unnecessary. Some examples where I have found them valuable include:
-
Quick prototyping. Not MVPs where the code will be retained, but proofs of concept where the code will eventually be discarded. This applies not only to testing game ideas, but also to exploring how a particular mechanic or system might work.
-
Internal tooling. Performing a task manually can be tedious, and having a tool that handles it correctly 80% of the time can still provide significant value. Rather than spending time perfecting the tool to handle every edge case, you can generate something functional in a few prompts and manually handle the remaining 20% of cases.
-
Writing documentation. This is one of the most tedious tasks for me. Documentation that is 80% correct rarely causes serious problems, and a quick review is usually enough to fix the most obvious issues. Any mistakes that slip through are likely to be discovered later, but they generally have little impact on the final product.
-
Suggesting potential bugs. Even if an LLM fails to identify every issue, produces false positives, or flags problems that are not worth addressing, I still make the final decision about which findings are worth investigating and fixing.
-
Generating large amounts of input data, feeding it into methods, and validating the output can be useful when tracking down difficult bugs. Having an LLM generate large amounts of input and automatically verify the results may help identify the root cause of an issue. Any mistakes it makes during this process do not affect the production code and can simply be ignored.
This input could also involve automatically playing a section of your game repeatedly until a bug occurs, while logging everything that happened during the run in which the bug appeared. However, I have never personally used it in this way; I have only used it for generating data to feed into methods.
-
An AI powered rubber duck: Rubber duck debugging - Wikipedia. This doesn’t only serve as a dumb duck exchanging ideas and organizing thoughts, but is also very good at blowing off steam. LLMs are made to please, they don’t mind how you talk to them.
This discussion is specifically about using LLMs within Unity. I have many additional thoughts on why they are problematic for production code and how they can create more issues than they solve in final implementations, but that is beyond the scope of your question.
In general, I would recommend keeping a backup of your project and avoiding the use of LLM generated output in anything that will directly ship as part of the final product. Instead, use them for tasks where being correct 80% of the time is sufficient. ( For some people, that 80% may even be enough for a final product because they would never have reached that point without LLMs in the first place, but that is a separate discussion.)
I won’t go in the jungle this time, I think most people know my opinion about that train-wreck some people like to call “AI”.
Just something to keep in mind: if you’re using AI service in the cloud you’re
- giving away your entire project (if you feed it to)
- giving away other people’s work (if you use any kind of 3rd-party asset or lib)
- if you are working under an NDA and it does not contain an exception for it, you’re breaching it and at the first convenient occasion, they will hand your *ss to you in court
If you are so lame that you can’t work without “AI” at least use a local one so you aren’t giving away everything to greedy (and stealing) corporations on the internet.
- giving away your entire project (if you feed it to)
That is perfectly incorrect! ![]()
If you tell AI to “fill my scene with the prefabs in folder Xyz” it won’t transmit all those prefabs, their meshes, their materials, textures and shaders. That would simply explode any AI due to the sheer size of the combined assets. It would also be completely pointless, since even us humans can drop prefabs into a scene without looking at each of the linked assets in detail.
What AI will do at most is read the metadata like the MeshRenderer bounds to perform the operation. Binary files are almost never transmitted unless the prompt specifically requires it ie “analyze why this PNG won’t open” and then it would still only read the PNG header bytes.
- giving away other people’s work (if you use any kind of 3rd-party asset or lib)
See above, plus: it depends on the AI’s terms of use. If it’s a commercial service it will have terms guaranteeing users that their prompts will not be stored nor used to train the AI. This is how most paid AI and certainly the commercial/enterprise grade AI services differ from “free” AI solutions.
If you are so lame that you can’t work without “AI”
So a programmer working in Notepad without Intellisense and refactoring tools is the least lame programmer in the world?
AI is a tool. A powerful one.
Just yesterday, I was too tired to think anymore and the match was about to start but I really wanted to figure out why the recent change to pooling items made them get sucked back in right after spawning, regardless of distance to player.
A quick prompt to AI pointed me to the flag I had overlooked when resetting. It also pointed out another issue I hadn’t even found yet where the scale of spawned items would be the scale of the item’s previous lifetime due to an order of execution issue.
@laplandhusky I should add that if you haven’t used AI much for coding yet, it’s sometimes useful to give it screenshots of the Editor. For my failed scene, I gave it one screenshot and as it worked it kind of tells you what it’s doing, it said “I found one problem, the AR Session is disabled…” which was going to lead it down the wrong path. So, you can ‘steer’ it’s thinking while it’s working, so I told it 'FYI, it’s disabled on purpose at scene launch…", that kind of thing helps keep it focused.
Per some of the comments, I would definitely not recommend starting a whole Unity project with it and I haven’t. Other code projects I have, but with the link between the Editor, Scenes and code I think it would be problematic. It would take time to figure out what it made in code and probably be confusing. I think it’s better for specific tasks and troubleshooting a project that’s already well along.
One thing I don’t like about AI programming (agentic) is that, when I code manually, I’m also thinking more deeply about the problem I’m solving. Many ideas and insights emerge naturally as I work through the process of writing the code. Solutions comes to me more naturally and less stressful.
when I code manually, I’m also thinking more deeply about the problem I’m solving. Many ideas and insights emerge naturally as I work through the process of writing the code. Solutions comes to me more naturally and less stressful.
I know what you mean, but strictly speaking the solution should emerge before writing code. ![]()
That’s where being forced to write specifications, no matter how crude, as a means to prompt the AI with has its benefits too.
The fine line is writing the code yourself you’re better of writing yourself, and letting the AI write the code you don’t even need to understand deeply - it just needs to work (for now). Refactoring is always an option. I’m no longer hunting for the clever, the “best” solution or spending time (and introducing bugs) to “improve” my code. I sometimes perceive a flaw in the code and it’s nothing that two or three steps of refactoring could fix. I hand this over to AI with my clear intent, and the result is often more complete than I had initially considered. Both cases are very liberating in the sense of freeing up both time and peace of mind.
Every so often I write a prompt that I don’t even send because then the steps are clear to me and I’ll just put them in. Those sort of revelations usually happen when something’s obtuse on first sight or I’m mentally exhausted or preoccupied. And it’s got nothing to do with AI, even in the past I was typing emails to colleagues or forum members that actively helped me resolve the issue, message never sent.
So yes, thinking deeply about a problem and coming up with “the solution™” is a positive boost, very satisfying. On the other hand, when I thought I had it all thought through and clear, and then AI tells me “why not simply do this?” and I’ll be like “Uh, okay. Right, I didn’t even think about it that way!” that’s where the pair programming aspect reaps big and sometimes surprising rewards.
I use AIA in Unity a lot and it’s great. Only gripe is high credits usage for agentic work.
It knows the project so implementing changes at specific places is quick and mostly reliable. Instructing it to add something new with respect to existing methods and standards works great as well.
I always ask/discuss solution with it before going into agentic mode, to make sure “everyone” are on the same page.
I’m a heavy user of VS for over 20 years now and despite doing a lot of terminal/linux programming as well I never understood all the hype of "CLI"s like Claude. Maybe for webdev but for stuff where you need a robust debugger, work with diagnostic tools - I don’t get it. But I’m just old man shouting at the clouds.
I also never had a problem with VS and Unity (maybe at early years when attaching debugger to the Unity project was buggy).
The only problem I have is a bad engineering on Unity side with regards to handling domains reload - I understand stuff might crash but forcing user to use Task Manager to kill it, as the only option of recovery it’s just beyond me.
The only problem I have is a bad engineering on Unity side with regards to handling domains reload - I understand stuff might crash but forcing user to use Task Manager to kill it, as the only option of recovery it’s just beyond me.
You posted about Unity crashes during domain reloads in this topic:
So, it’s a July 2026, Unity 6.5 version - when you will be ready to finally release a version which does not hang up on random domain reloads? As a Unity customer I’d like to be treated seriously, for once. How much more knowledge, experience, spiritual connection to other beings, Dear Unity Team, you still need to acquire to finally release a software which does not hang up on domain reload in the face? Nope, there’s nothing meaningful in the Editor log: Finished compiling graph: 1555 nodes…
When we asked for more information about when and how the crashes occur, you refused to provide any details and instead responded with the usual “bad Unity, not my fault” type of comments, without providing any useful information about what is actually happening.
Now you have come here and posted the same issue again, in a topic that has nothing to do with domain reloads.
Spamming and low-effort posts are against the forum rules. Reported for moderation.