I tried to use ChatGPT to create code for a simple 3D Unity game. OpenAI’s new chatbot created all of the code, I only copy pasted it and did some small adjustments where necessary.
I’m a 22 year old computer science (games engineering) student.
I like creating games, modding games, and implementing other fun coding projects.
Consider subscribing 🙂
#gamedev #chatgpt #unity
Canted GPT Creator unity game let’s try Please give me a script for a Unity Player controller This is what it generated let’s try it I Created a new Unity project a cube as a Player object I attached a script and I Copy and pasted the code from chatgpt [Music] Let’s hit play and see what happens [Music] It works Nice it’s not bad okay so it can Definitely do some basic things next I Asked it to give me a camera follow Script so that the camera follows the Player and also only moving left and Right is really boring and let’s add Some jumping and maybe a slide to the Player controller Okay yeah it’s moving Can jump I can jump I can double jump I Can double jump forever though [Music] Okay so I can move and like lift control Should be sliding Okay I don’t know what other shift Take a quick look at the code again Now as you can see this is where things Stop working this slide doesn’t work at All so I took a look at the code and I Realized that the vector was in the Wrong direction now you might be asking Yourself how can Dai make mistakes well Chat GPT is only trained on a language
Model so it generates text it doesn’t Even know what code is it doesn’t know What Maps is it can even get some simple Equations wrong because is only Generating text Why do programmers always mix up Halloween and Christmas because OCT 31 Equals deck 25. It’s funny because In the Decimal System 25 is the same as 31 in the octal system by the way jokes Get funnier if you explain them Asking the AI for the sum of all primes Under 15 has some weird results It says the sum of all primes under 15 Is 47 and then it lists all the Primes Which are 2 3 5 7 11 and 13 but that’s Wrong An interesting thing we can do is ask The AI if it thinks that this is true so What is the sum of all of these numbers Now it says the sum is 41. so you see it Doesn’t know Maps it just Put some language together and sometimes It’s right because it trained on the Right data but sometimes it’s wrong So I fixed the slide by changing the Vector and now it’s kind of like a slide More like a flip thing but I guess it Works Now to make this feel more like a game I Also added some moving platforms and a Collectible to the game by asking for a Script and attaching it to the game
Objects This is definitely an easy way to Quickly prototype something but there’s A problem like I said the AI can make Mistakes and if you don’t know how to Code you can’t really fix them so while It’s fast to get some code it might not Be good code or it might not even work At all Thanks for watching my video on creating A game using Code generated by Ted GPT I Hope you found it informative and it Inspired you to try and chat GPT for Yourself remember the possibilities are Endless when it comes to what you can Create with this powerful tool whether You’re a seasoned programmer or just Getting started with coding chat GPT is A great way to generate code quickly and Easily happy coding Also don’t forget to like And subscribe If you enjoyed the video [Music] Thank you foreign [Music]