With the rise in the usage of AI, I wanted to see if it’s capable of making a VR game from scratch. So to find that out, I used ChatGPT as my AI tool and before I get started with this research, I had to set some rules and those rules were:
So with the rules being set, I could now start developing the game.
Considering I am a beginner not knowing how to use Unity, my first question to the AI was straightforward.
Hey, can you help me create a VR game using Unity?
Although the AI provided detailed instructions, they did not align with my needs. Specifically, I wanted to use the XR Interaction Toolkit package and asked the AI on how to use it.
I want to use XR Interaction Toolkit
The listed steps were insufficient to set up Unity for VR. It asked me to refer to the documentation for more details, but this was not satisfactory.
So, AI did not entirely help me set up my Unity Project. Since I already have a base project setup for VR using the XR Interaction toolkit, I went ahead and used it.
<div class=callout><div class="callout-emoji">💡</div><p style="margin-bottom:0px;">You can get the Base Project as well, check out this video.<p></div>
My goal is to create a basic shooting game in which:
This outline provides the core features of the game, but there may be additional details to consider as I continue to develop and refine it.
Based on the game features, here are the following questions I asked the AI:
After every question I asked, I copy pasted the script into Unity and tested it. If it did not work as expected, I would ask the AI to update the script.
Now that I had most of the script ready and done testing it, it was time to import assets and make the game.
I thought it would be fun to use chickens as enemies and eggs as their ammo, so I imported them from the Unity asset store.
Then, I imported a gun and bullet assets for the player.
Created Canvases to display the Kill Count and the health of the Player. Just to keep it simple, placed the Kill Count Canvas at one of the sides and the player health at the top of the left gun
I added all the scripts and tested the game and while doing so, I found that:
Which meant it was time to go back and ask the AI to fix it.
Here is what I asked the AI to do:
So with that, I had everything that I needed and it was time for the final polishing.
The AI was able to generate code for various aspects of the game, including shooting bullets, enemy behaviour, health management, spawning enemies, keeping track of enemy kills, handling player and enemy death, and displaying information to the player. However, the AI was not able to fully assist with setting up a Unity project for VR, and the researcher had to rely on a pre-existing base project instead.
Overall, I can say that AI did make this VR game for me but the game was not optimized and the codes were not of production level. For example, it uses public property instead of private in most of places. While spawning enemies it does not make use of object pooling. It sometimes even changed the code entirely when asked to update by just making a small change.
It’s okay to take the help of AI for prototyping and getting answers if you are stuck but you will have to make quite a few changes to it. You will not be able to use AI to create a production-level game.
If you've enjoyed the insights shared here, why not spread the word? Share the post with your friends and colleagues who might also find it valuable.
Your support means the world to us and helps us create more content you'll love.