Skip to content

This is "Keith: Retrieving the Medal", my final project for Harvard's GD50 course. This is a 3D Unity game. "Keith" is copyright of Eduardo Salinas.

License

Notifications You must be signed in to change notification settings

eduardoluis11/keith-gd50

Repository files navigation

Keith: Retrieving the Medal

This is "Keith: Retrieving the Medal", my final project for Harvard's GD50 course. This is a 3D Unity game.

Author:

This game was created by Eduardo Salinas.

The "Keith" game series is copyright of Eduardo Salinas.

Video with a demo of the game

Keith: Retrieving the Medal

What I did, and why I did it

I made a 3D game in Unity 2021, which is a hack ’n’ slash game in which you need to defeat a boss to win the game. The game was supposed to be an Action RPG, but I wasn’t able to add the RPG elements to the game such as being able to level up due to time limitations and to prevent the game from having additional bugs. In it, you’re a swordsman called “Fang”, and you need to defeat an evil robot called “The Imanus”.

Well, to make the game, I created 4 scenes: one for the Main Menu or “Press Start” screen, another one for the gameplay itself, a third one for a Game Over Screen, and another one with a victory message once you defeat the boss.

You need to press Enter in the Press Start / Main Menu scene in order to play the game. Also, in the Main Menu scene, if you press the “Esc” key, you will be able to exit the game.

In the game, I created a single level using the Probuilds tools from Unity. I created a single arena for the game, which is where the player and the only enemy of the game will fight. I created 4 planes around the boss’ arena. These planes act like a wall to prevent the player from walking off the edge of the arena and fall into a bottomless pit. Still, I don’t recommend the players getting too close to the walls, since the floor’s collision detection gets wonky near the walls, and the player seems to fall if they get too close to the walls.

You will need to attack the enemy as fast as possible to defeat him. Otherwise, the enemy will defeat you. There’s no way to heal in the game. You start with 40 points of Health, whereas the enemy will start with 100 points of Health. You can deal 13 points of damage, while the enemy deals 4 points of damage. For the time being, this was the only way to balance the difficulty. That is, if you attack the enemy quickly enough, you will be able to defeat him and win. Otherwise, if you take too long in attacking him, the enemy will defeat you, and you’ll get a game over.

You need to left-click to move, and right click on the enemy to attack him.

If the enemy doesn’t spot you, he will remain idle and won’t move. However, if you get close enough, the enemy will chase you.

Once you defeat the enemy, you will go to a new scene that will display a message saying “Victory!”. The only thing that you can do here is pressing Enter to go back to the Main Menu. This way, you’ll be able to replay the game or to exit the game if you go back to the Main Menu.

Similarly, if you’re defeated and get to the scene displaying a “Game Over” message, the only thing that you’ll be able to do is to press Enter to go back to the Main Menu. Once again, I did this so that you could easily replay the game or exit it by making you quickly go from the Game Over scene to the Main Menu scene.

The Health Points for both the player and the enemy are displayed onscreen as numbers. If the enemy’s HP drops to zero, you win. Meanwhile, if your HP drops to zero, you lose and you’ll get a Game Over. I put the UI Text with the HP in the lower corners of the screen so that the black text would be easy to read on the white floor of the game. If I had put the HP UI text in the upper part of the screen, I would have had to add a mask or colored-box with a light color so that the player would be able to easily read the black text on the background. Therefore, to make the game as quickly as possible, I ended up just moving the HP UI text to the lower part of the screen.

The game is relatively simple. I had no choice but to make the game this simple to prevent many bugs. I had bugs that made the camera shake too much, that made the enemy and the player fall if they collided with each other, among other bugs. Therefore, I didn’t have a choice but to make the game simple to prevent many of the bugs that I was encountering.

I added some 3D Models from the Unity Asset Store for Fang and The Imanus, that is, for the player and for the enemy. I looked up some free samurai or knight 3D models from the Unity Asset Store, and found a medieval cartoon knight that I ended up using for the player character. The knight already has a sword, movement, and sword animations. It’s good enough for the player character for the time being. As for the enemy, I ended up using a free Unity asset of a robot. I only needed a simple robot that looked hostile. You need to add these 2 assets for the game to work properly, if I don’t include it with the source code. Here’s the 3D model for the player character: https://assetstore.unity.com/packages/3d/characters/medieval-cartoon-warriors-90079#publisher . Meanwhile, here’s the 3D model for the enemy: https://assetstore.unity.com/packages/3d/characters/robots/medium-mech-striker-124342 .

For the physics of the game, I left both the player and the enemy with kinematic physics. First, I had to add a Rigid Body to both the player and the boss. Then, I made them kinematic. That is, if they collide with each other, neither of them will be pushed around, nor fall to the floor. I did this since, if I left the “is kinematic” value unchecked in the Unity editor, many bugs occurred. The player wouldn’t be able to get close to the enemy without falling to the floor. Also, if the enemy touched the player’s 3D model, the enemy would end up falling to the floor, and then he would start flying.

For the collision detection, I used a capsule collider. The 3D models that I ended up using were the complex 3D models of the medieval cartoon character and the robot. However, the actual collision detection is detected via a capsule collider. That is, there’s an invisible capsule surrounding both the player and the enemy 3D models, which handles collision. I did this since capsules are normally used for collision detection for characters in games, since the rounded area on the top of the capsule would simulate the roundedness of the character’s head. That is, if you attack the character’s head, it would be better detected by the game by using a capsule collider than a box collider. And of course, I didn’t add a complex collision detection mesh that would detect the entire shape of the knight nor the robot 3D model, since doing that would use too many resources, and would make the game run too slowly. So, instead, I used a simpler capsule collider for the collision detection.

How to play

To play this game, you need to left click to move, right click to attack with your sword. If you run out of Health points, you die and get a game over, and if you deplete the enemy’s HP, you win the game.

You can exit the game by pressing the “Esc” key in the Title scene in the Main Menu.

If you get a Game Over or you win the game, you can press Enter to go back to the Main Menu.

You can rotate the camera by pressing the “A” and “D” keys, and you can zoom the camera in or out by rotating the Mouse wheel.

Why I believe it to meet the complexity and distinctiveness requirement

My game is made in Unity, which makes it more complex than around half of the homework assignments for GD50. Out of the 11 or so assignments, only 3 assignments required you to use Unity (four if you do your final project with Unity). The rest of the assignments, which are around 8, require you to use Lua and Love2D. Given that 3D Unity games are way more complex than 2D games made in Love2D, and given that my game for my final project is a 3D Unity game, my game is more complex than most of the assignments for this course. So, since it’s a 3D Unity game, that gives some level of complexity to my project when compared to other assignments in this course.

Also, of the 3D games in this course, no other game has a 3rd person camera that you can control mid-gameplay other than mine. Out of the most complex games in the course, which are the 3D Unity games, they either have a first person camera, or use a 3rd person camera at a fixed angle. Well, my game uses a 3rd person camera that you can both rotate, and zoom in and out. I had to look up a tutorial on the internet to find out how to make a 3rd person camera in Unity that you can control while playing the game. So, I needed to learn some extra things that were not taught in previous homework assignments to make my final project. Therefore, the fact that I had to learn how to implement a controllable 3rd person camera in a 3D game makes my project some level of complexity, since I couldn’t copy and paste the code for handling cameras from other of my previous projects.

Another reason why my project is more complex than previous homework assignments is the number of 3D animations that I used in my Unity project, when compared to the other Unity projects for previous homework assignments. The portal homework assignment didn’t have any animations whatsoever. The Dreadhalls assignment only had 1 animation: the rotation for the 3D model of the pickup. Similarly, the Helicopter Game only had 1 animation for the player character, for the enemies, and for the diamonds and coins. The diamonds and coins only used a rotation effect for their animations, which is a basic type of animation. As for the player character in the Helicopter game, it only had the “idle” animation for the helicopter, in which the helicopter’s blades were rotating, and the explosion animation when you crashed onto something. I think the enemies also had an “idle” animation. So, in the Helicopter game, there were like a total of 4 or 5 animations, in which all items and most characters had only 1 animation. Additionally, I technically didn’t have to add any animations to any of the games. With probably the exception of the Helicopter game’s diamonds, I didn’t have to add any animations for any of the previous homework assignments. Meanwhile, my game for my final project had way more animations than any other previous homework assignment in the GD50 course.

I had to manually add animations for my game for my final project. I added animations for both the player character and the enemy. I had to configure the animator controllers for both the player and the enemy, as well as find free assets that would come with pre-installed animations. I never had to look up nor any assets from the Unity Store for any of the previous projects. Also, I never had to configure the animations by using the animator controller in the Unity editor in previous homework assignments. So, since I had to learn how to install new assets from the Unity store, and that I had to learn how to configure the animator controllers for the characters in the game, my game is more complex than previous homework assignments.

Likewise, my game used more animations than any other previous project in this couse. The playable character has at least three types of animations: one for being idle, one for running, and one attacking. Well, since the player character has both a walk and a running animation, and since the player gets into a combat stance animation right after swinging his sword, the total number of animations is of at least 5, and just for the player character. Also, since the player character has 2 sword slashing animations when he attacks, the player character alone technically has 6 animations. Meanwhile, the enemy has its own number of animations. It has animations for walking, running, idle, and both a left punch and a right punch attack animation. So, the enemy alone has at least 5 animations. So, combining the number of animations for both the player and the enemy, there are at least 11 animations in my final project. No 3D unity game in the course has this many animations. So, my final project is more complex than previous projects in the course.

Also, my project is complex since I had to make the entire level from scratch. With the only exception of the Portal project, all the walls and the floors for all the 3D Unity games in the course were already pre-installed with the game. Meanwhile, in my final project, I had to build all the walls and the floor for the combat arena present in the game using the Probuilds level editor. This makes it similar to the Portal project. Well, since the Portal project was more complex than pretty much every other project in the course, and given that I had to build levels in a similar fashion in my final project as in the Portal assignment, my game is more complex than most other previous homework assignments.

Lore and background information

The enemy of this game is a killer robot who killed the biological parents of a 10 year old child called “Keith”, and it stole a medal from Keith. Keith’s medal was a memento from his parents, since Keith and his biological parents won that medal in a game at a school event in which parents could participate with their children. The Imanus took that medal since it seemed valuable, and as a trophy for having killed Keith’s parents. The Imanus was the leader from a group of evil terrorist robots that attacked Keith’s village and killed other innocent civilians in the village.

Fang was able to scare away both The Imanus and the robots that were attacking Keith’s village. Since Fang saw that Keith didn’t have anywhere to go, Fang took care of Keith. After enjoying taking care of Keith for a few days, Fang decides to adopt Keith. Well, after a few conversations, Keith tells Fang that the Imanus stole his medal. Therefore, Fang decided to go find The Imanus to finish the job, avenge Keith’s parents, and retrieve Keith’s medal, which was a memento of his parents.

This is a sidequest of a full game called “Keith” that I want to make someday. The idea of Fang tracking The Imanus to retrieve Keith’s medal is an idea that I had since 2 years ago. This mission will be a sidequest in the full game, once I finish it.

Note that I made a web game for the Web50 course called “Keith”, which also takes place in the same game world as this Unity game. However, the web game was a 2D game made in Javascript, and it played liek a 2D sidescroller, and it had RPG elements, such as being able to level up. Also, enemies couldn’t either attach nor move in the web version of the game. So, this unity game is completely different from the Keith web game that I did for web 50.

Notes

Disclaimer: Use of LLM AIs

I used GitHub's Copilot, ChatGPT 4.0 / Omni, the free version of ChatGPT, and Bing's AI to write the code for this project, as well a for creating the references in APA format in this README file.

References

  1. ChatGPT. (2024). It transcribed all of my notes from my notebook. I took pictures of my notebook with my game design ideas, and asked it to transcribe it.
  2. DanCS. (2021, October 10). How to make a combo system in Unity in less than 7 minutes [Video]. YouTube. https://www.youtube.com/watch?v=gHaJUNiItmQ . Accessed on April 27th, 2024.
  3. Unity. (2020, June 18). Implementing an ability system | Prototype series [Video]. YouTube. https://www.youtube.com/watch?v=Jv9jGyIWelU
  4. Unity Learn. (2020, June 29). Implementing an Ability System - Workshop Video. Retrieved from https://learn.unity.com/tutorial/implementing-an-ability-system-training-video?uv=2019.3&courseId=5ee7df73edbc2a001edbc7fd&projectId=5eea865cedbc2a0023b03b00#5eea8ad8edbc2a002071fce7. Accessed on April 27th, 2024.
  5. ChatGPT. (2024). Ok, take all that text from all the transcriptions that you did during this chat, and include the following text, and create me an algorithm for a 3D Unity game with all the ideas from the transcripts that you just did for this chat, as well as the ideas from the following text.
  6. ChatGPT. (2024). "Coll. Well, could you give me the links to any of those Youtube videos or playlists?" Accessed on April 27th, 2024.
  7. ChatGPT. (2024). "Let me rephrase the question: could you give me links to any Unity resources that would help me make an action RPG like the one that I want to make?" Accessed on April 27th, 2024.
  8. ChatGPT. (2024). "There's an extra mechanic that I forgot to inculde: earning EXP. This is an action RPG, so you level up. By defeating enemies, you earn experience, so that you can level up. By leveling up, your stats increase (HP, Defense, Attack points). Jot that down." Accessed on April 28th, 2024.
  9. ChatGPT. (2024). "Thanks! Now, give me an algorithm, both for C# code and the functionalities that I'll have to sue for the Unity Editor, to do the following things for my game: '4. Enemy Types: - Ground enemies with melee and ranged attacks - Aerial enemies with diving and swooping attacks'." Accessed on April 28th, 2024.
  10. Salinas Rivas, E. L. (2024). LoadSceneOnInput.cs file from Eduardo Luis Salinas Rivas, Dreadhalls Project. GitHub. Retrieved from https://github.com/eduardoluis11/dreadhalls/blob/main/Assets/LoadSceneOnInput.cs. Accessed on April 28th, 2024.
  11. ChatGPT. (2024). "Awesome. Now, make me an algorithm for the c# scripting and the unity editor for making this part of my game: '5. Boss Mechanics: - "The Imanus": Final boss with various attack phases'. I've attached you some of my own drawings to represent some of the boss mechanics. ost of the images show the boss' attacks. In the first image, I show that the boss will be able to summon some laser balls that will surround the player to then hurt him. In the 2nd image, I show an attack in which the boss lunges at the player to tackle him (the boss is the one with horns and a crown). In the 4th image, I show the boss launching missiles at the player as one of his attacks. Then, in the 3rd image (yes, it's in the wrong order), I show a sketch that shows that, if the player hits the missile with his sword, the missile will be sent back to the boss, and damage the boss. The boss will also become staggered by that missile hit, which will give the opportunity to the player to land multiple hits to the boss. Those images and these descriptions that I've been writing are a summary of the boss' attacks and mechanics. So, knowing all this, create the algorithm for the c# scripting and the algorithm to create the boss' mechanics for my Unity game." Accessed on April 28th, 2024.
  12. WakeTechSGD. (2021, November 2). Installing Pro Grids into Unity [Video]. YouTube. Retrieved April 29, 2024, from https://www.youtube.com/watch?v=CfDikSGFQFs.
  13. Brackeys. (2018, April 22). MODELING IN UNITY?! - ProBuilder Tutorial [Video]. YouTube. Retrieved April 29, 2024, from https://www.youtube.com/watch?v=PUSOg5YEflM.
  14. ChatGPT. (2024). "Thanks. Now, create me an algorithm and tell me some tips on how to do the c# scripting for the following algorithm: '1. Player Character "Fang" with abilities: - "Techne": Physical combat skills - "Episteme": Magical abilities'. And, in general, tell me how to create a playable character for a third person game in Unity in 3D to create my main character on my main scene. I will use a capsule as the object that will represent Fang, the playable character. However, if you could tell me how to attach a 3D model of a human to it, the better." Accessed on May 1st, 2024.
  15. Díaz, J. (2024). Medieval cartoon character for Unity. Unity Asset Store. Retrieved from https://assetstore.unity.com/packages/3d/characters/medieval-cartoon-warriors-90079#publisher. Accessed on May 1st, 2024.
  16. MSGDI. (2023, August 2). Medium Mech Striker | 3D Robots. Unity Asset Store. Retrieved May 1, 2024, from https://assetstore.unity.com/packages/3d/characters/robots/medium-mech-striker-124342.
  17. Díaz, J. (2024). Set Character Tutorial. Youtube Tutorial explaining how to import the Medieval cartoon charactewrs into the Unity Scene. Retrieved from https://youtu.be/sz7QUqFeuTY?si=I1ZTSisYXCr-hpTz. Accessed on May 1st, 2024.
  18. ChatGPT. (2024). "I'm making a 3D game using the Unity Engine. Now, my game is a 3rd-person game. So, I want the camera to follow me around, just behind the player character, in a 3rd-person camera view. Tell me how to do this in Unity for a 3D game." Retrieved from https://chat.openai.com/share/c21508a7-c2e9-4406-9d38-66a7af89b0df. Accessed on May 4th, 2024.
  19. ChatGPT. (2024). "Thanks. Now, I have both the player character and the game's boss with a capsule 3d object, and both have a RigidBody component. Well, right now, if I touch the boss with the player character, the player character falls to the floor, as if he had been toppled by the boss. Could you tell me how to make the player character touch the boss character without either of them falling to the floor? What I did in both the player character and the boss character was to create a 3D capsule game object, attach a RigidBody component to the capsule, and drag and drop the character's game object inside of the capsule. Thanks to that, they're both affected by gravity, and if they touch the floor, they won't clip through the floor. However, right now, the capsule's 3D model is covering 3D model of each character. Also, there's the issue that, if the player touches the boss, the player falls to the ground. So, tell me the ideal way to add collision detection to both characters, how to make the capsules be invisible (if I even have to use them), and tell me how to prevent the player character from falling to the floor if he touches the boss' 3D model. I'm using Unity 2021." Retrieved from https://chat.openai.com/share/c21508a7-c2e9-4406-9d38-66a7af89b0df. Accessed on May 4th, 2024.
  20. ChatGPT. (2024). "Cool. Well, now, In my Unity game, I want to be able to rotate the camera while moving the mouse. As of right now, the camera will always be behind the player character. However, that means that I can't see behind Fang's back. Well, I want to be able to move the camera if I move my mouse. Tell me how to do that. I'm using Unity 2021." Accessed on May 5th, 2024.
  21. ChatGPT. (2024). "Thanks. Now, Fang, the player character, never turns. Yes, I can move in all directions using the WASD and arrow keys. However, his character 3D model never looks back. So, if the boss is behind me, I would be unable to turn and attack him, since the player character's 3D model never turns back, even if I walk backwards. How can I make the 3D model of my player character to turn around once I start walking backwards?" Accessed on May 5th, 2024.
  22. Copilot from Pycharm: Professional Edition. (2024). "/fix I'm making a 3D unity game which is a 3rd-person Action RPG in which you fight against a boss by using your sword. This script handles the movement of the playable character, who's called "Fang". Well, this code lets the player walk, and, if they walk to a side, they will turn around. However, the camera shakes whenever the player moves. On the default speed, which is of "5", is not that noticeable, but the player walks too slowly. At higher speeds, the player can move quick, but the camera shakes so much that it gives me motion sickness, making the game virtually unplayable. Meanwhile, if I remove any rotation from this code, and use "transform.Translate(movement * speed * Time.deltatime)", the player can move quickly and the camera won't shake, but the 3D model won't be able to rotate when walking to a side or backwards. So please, take this snippet, and tell me what should I do in my Unity game to remove that camera shake whenever the player character moves by using this script." Attached the PlayerMovement.cs script. Highlighted lines 23 to 59 from the PlayerMovement.cs script. Accessed on May 6th, 2024.
  23. Copilot from Pycharm: Professional Edition. (2024). "/explain That didn't work. The camera is still shaking while I move. Please, tell me what the selected snippet does. Then, tell me if you can find out what's causing the camera shaking." Attached the PlayerMovement.cs script. Highlighted lines 23 to 59 from the PlayerMovement.cs script. Accessed on May 6th, 2024.
  24. Copilot from Pycharm: Professional Edition. (2024). "/fix The FollowCamera.cs script is the one that generates the camera shaking bug. I want the camera to follow the player character while they move. However, the camera shakes whenever the player moves. So please, modify this function so that the camera stops shaking while the player moves. This script is currently attached to the camera game object." Attached the FollowCamera.cs script. Highlighted lines 15 to 29 from the FollowCamera.cs script. Accessed on May 6th, 2024.
  25. Copilot from Pycharm: Professional Edition. (2024). "Well, look at my current code for the FollowCamera monobehavior. Use the current code, since the code that you gave me made the camera to follow the player from way too far away, and I wanted the camera to stay closer to the player. Well, is there a way to make the current code to make the camera move even smoother, be it by making it more optimized, or to make it lag less while following the player?" Attached the FollowCamera.cs script. Highlighted lines 15 to 29 from the FollowCamera.cs script. Accessed on May 6th, 2024.
  26. Unity. (2020, September 21). Creating a Third Person Camera using Cinemachine in Unity! (Tutorial) [Video]. YouTube. Retrieved May 7, 2024, from https://www.youtube.com/watch?v=537B1kJp9YQ.
  27. "PlayerMovementInputController.cs" file. (2020). In Unity (Ed.), Creating a third person camera using Cinemachine in Unity! (Tutorial) [Code file]. Retrieved from https://www.youtube.com/redirect?event=video_description&redir_token=QUFFLUhqbU42cmQ1akVuLXBpMkdnWHdKVFU5b3cwME1HUXxBQ3Jtc0trQ2dMM195ZlBYaE4tQXdKMHQ4X3RRQU5ZbDNqSmVGYmdrTHllZDdtVk5zZmJhMWo0bDZOSl9ONWYtY2tQSWQwb2tjQl9lWGNxVm9DTHBMUFRubjNPUFgtSWo5NVJaQWlweVV2OFNVUmMtamNTY1lQSQ&q=https%3A%2F%2Fon.unity.com%2F36nVNzt&v=537B1kJp9YQ
  28. Copilot from VS Code. (2024). /fix This line of code is giving me a bug in the editor of Unity 2021. This is the error message: "Assets\PlayerMovement.cs(49,24): error CS0246: The type or namespace name 'InputAction' could not be found (are you missing a using directive or an assembly reference?)". The game does not compile unless I fix this. How can I fix this? Highlighted line 49 from the PlayerMovement.cs script. Accessed on May 8th, 2024.
  29. Copilot from VS Code. (2024). @workspace /fix I'm already doing that, and that didn't fix the bug. In fact, I have yet another bug in the Unity editor that doesn't let me execute my game that says: "Assets\PlayerMovement.cs(4,19): error CS0234: The type or namespace name 'InputSystem' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)". So, how can I fix this bug? Highlighted line 4 from the PlayerMovement.cs script. Accessed on May 8th, 2024.
  30. "PlayerLocomotionsInputController.cs" file. (2020). In Unity (Ed.), Creating a third person camera using Cinemachine in Unity! (Tutorial) [Code file]. Retrieved from https://www.youtube.com/redirect?event=video_description&redir_token=QUFFLUhqbU42cmQ1akVuLXBpMkdnWHdKVFU5b3cwME1HUXxBQ3Jtc0trQ2dMM195ZlBYaE4tQXdKMHQ4X3RRQU5ZbDNqSmVGYmdrTHllZDdtVk5zZmJhMWo0bDZOSl9ONWYtY2tQSWQwb2tjQl9lWGNxVm9DTHBMUFRubjNPUFgtSWo5NVJaQWlweVV2OFNVUmMtamNTY1lQSQ&q=https%3A%2F%2Fon.unity.com%2F36nVNzt&v=537B1kJp9YQ
  31. Copilot from VS Code. (2024). Scene Manager Quick Fix on VS Code from the PlayerDies.cs script on Line 30. Retrieved from https://github.com/eduardoluis11/dreadhalls/blob/main/Assets/PlayerDies.cs. Accessed on May 18th, 2024.
  32. Salinas, E. (2024). "DespawnOnHeight.cs" script from my "Dreadhalls" project. Retrieved from https://github.com/eduardoluis11/dreadhalls/blob/main/Assets/DespawnOnHeight.cs. Accessed on May 18th, 2024.
  33. Copilot from VS Code. (2024). "If the player presses "0", they will go to the "Game Over" scene." comment on VS Code's copilot. PlayerDies.cs script. Accessed on May 18th, 2024.
  34. ChatGPT Omni. (2024). I created a Script in my Unity game so that, if the player presses the Escape key, they should exit the game and go back to their desktop. Well, I'm printing a debug message that says that the player has pressed the escape key when they press it. However, I don't see the game closing or anything while pressing the escape key while playing it in my unity editor. How do I know that my game is closing properly? Should I make a build of my unity game, and press esc to make sure that the game closes when I press the escape key? I'm using the 2021 version of Unity. Attached an image showing my Unity Editor with the debug message saying that I exited the game. Accessed on May 19th, 2024.
  35. ChatGPT Omni. (2024). "Awesome. That worked. However, my game has some bugs that only show up on the Build, but NOT on the Unity Editor. For instance, I start from a scene called "Main", instead of the "Press Start" scene. Also, the player moves way too slowly on the build. Finally, I attached a capsule to a 3D model of a medieval cartoon character, and, on the build, the capsule detaches from the cartoon character, so the capsule moves, but the cartoon character doesn't. These bugs occur only on the build, but not on the Unity Editor. Maybe I need to eliminate all my scenes from the “File -> Build Settings” window, and add them again from scratch? What's going on?" Accessed on May 19th, 2024.
  36. ChatGPT Omni. (2024). Cool. Now, I want to make the boss, "the imanus" follow the player around. If he touches the player, the player will receive damage. Give me a link to a youtube tutorial that tells me how to make an enemy and make the enemy follow the player around in Unity. Accessed on May 21st, 2024.
  37. James Waghmare. (2023, April 13). How to make an enemy follow player in unity | unity 3d | unity tutorial. Retrieved from https://www.youtube.com/watch?v=krKavfBuEQg. Accessed on May 21st, 2024.
  38. Pycharm Copilot. (2024). I want the main character of my Unity game, Fang, to have a property called "HP", which will store Fang's health points. He will initially have 100 points of HP. HP will be an integer. Well, I want to insert into the playable character's equivalent of it's "init()" function the property that will store their HP. Well, give me an algorithm that will let me assign new properties to the playable character, and create a property called "HP", which will be an integer. Tell me if it's better to create a new script, or if I should insert the "HP" property into one of my existing scripts. Just give me an algorithm for it. Accessed on May 25th, 2024.
  39. Pycharm Copilot. (2024). The thing is, as the name of that script suggests, that script is only supposed to handle the player's movement. I think it would be better to just create a new script to store the properties of the playable character, such as his stats (attack, defense, HP, etc). So, create me an algorithm for this new script that I want to create. Accessed on May 25th, 2024.
  40. Pycharm Copilot. (2024). Look at my current scripts, and tell me which one is telling my Unity game to move / rotate my camera when I move my mouse. I want to know that because, if I move my mouse upwards, the camera will move downwards, and vice versa. Well, I want to modify that so that, if I move the mouse upwards, the camera will look upwards. Attached the FollowCamera.cs and the PlayerMovement.cs scripts. Accessed on May 25th, 2024.
  41. Pycharm Copilot. (2024). Thanks. Now, give me an algorithm so that, if a capsule that contains an enemy makes collision with the player character, the player character will lose some HP (health points). I've already created the capsule for the enemy. So, give me an algorithm that will let me do what I just told you. I guess I would need to create a new script for handling the damage that the enemy can do to the player. Accessed on May 25th, 2024.
  42. Pycharm Copilot. (2024). Thanks. Now, make it so that, if the player character's HP drops to 0, that the "Game Over" scene will be loaded. This will make it so that, if the player loses all of his HP, the player will lose and get a Game Over. I attached the EnemyDamage.cs, LoadSceneOnInput.cs, and PlayerStats.cs scripts. Accessed on May 25th, 2024.
  43. VS Code Copilot. (2024). I clicked on line 45 in PlayerStats.cs in the "SceneManager" line of code, and clicked on "Quick Fix" on VS code to fix a bug in which I needed to import Unity's SceneManager library in order to load my scenes (like the Game Over scene). Accessed on May 25th, 2024.
  44. ChatGPT 4. (2024). Cool. Well, now, I have a bug in which, if the capsule Game Object for the enemy touches the player, the player will fall down to one of his sides. The player is a 3D model with a capsule attached to it. Well, the player's capsule falls down if the enemy capsule touches it. Well, what I want is that the enemy capsule should touch the player's capsule, so that the enemy hurts and deals damage to the player if the enemy touches the player. And I don't want neither the player nor the enemy's capsule to fall to their sides. Could you give me links to Youtube Unity tutorials that explain to me how to make a 3D enemy to touch and deal damage to the player? Accessed on May 26th, 2024.
  45. Night Run Studio. (2022, April 12). Player Health System #1: Taking Damage (Unity Tutorial) [Video]. YouTube. Retrieved May 27, 2024, from https://www.youtube.com/watch?v=_1Oou4459Us.
  46. Brackeys. (2017, July 26). MOVEMENT - Making an RPG in Unity (E01) [Video]. YouTube. Retrieved June 1, 2024, from https://www.youtube.com/watch?v=S2mK6KFdv0I.
  47. VS Code Copilot. (2024). @workspace /fix Thanks. Now, if I click on the floor in my Unity game, the player, which is represented by a cube, should move to that position. However, instead, when I click on the floor, I get this error message in Unity's console: ""SetDestination" can only be called on an active agent that has been placed on a NavMesh. UnityEngine.AI.NavMeshAgent:SetDestination (UnityEngine.Vector3) PlayerMotor:MoveToPoint (UnityEngine.Vector3) (at Assets/PlayerMotor.cs:25) PlayerController:Update () (at Assets/PlayerController.cs:43) ". The line of code that is causing that bug, and the line of code that should make the player move once you click on the floor, is the one that I'm currently selecting. What's causing this bug, and how do I fix it? Highlighted line 43 from PlayerController.cs. Accessed on June 2nd, 2024.
  48. Brackeys. (2017, August 2). INTERACTION - Making an RPG in Unity (E02) [Video]. YouTube. Retrieved June 4, 2024, from https://www.youtube.com/watch?v=9tePzyL6dgc.
  49. Brackeys. (2017, September 6). STATS - Making an RPG in Unity (E09) [Video]. YouTube. Retrieved June 11, 2024, from https://www.youtube.com/watch?v=e8GmfoaOB4Y.
  50. Brackeys. (2017, September 20). COMBAT - Making an RPG in Unity (E11) [Video]. YouTube. Retrieved June 12, 2024, from https://www.youtube.com/watch?v=FhAdkLC-mSg.
  51. Brackeys. (2017, June 27). PlayerController.cs. In RPG-Tutorial. Retrieved June 19, 2024, from https://github.com/Brackeys/RPG-Tutorial and the specific file at https://github.com/Brackeys/RPG-Tutorial/blob/master/Finished%20Project/Assets/Scripts/Controllers/PlayerController.cs.
  52. Brackeys. (2017, June 27). PlayerMotor.cs. In RPG-Tutorial. Retrieved June 19, 2024, from https://github.com/Brackeys/RPG-Tutorial/blob/master/Finished%20Project/Assets/Scripts/Controllers/PlayerMotor.cs.
  53. Brackeys. (2017, June 27). CameraController.cs. In RPG-Tutorial. Retrieved June 19, 2024, from https://github.com/Brackeys/RPG-Tutorial/blob/master/Finished%20Project/Assets/Scripts/Controllers/CameraController.cs.
  54. Brackeys. (2017, June 27). Interactable.cs. In RPG-Tutorial. Retrieved June 20, 2024, from https://github.com/Brackeys/RPG-Tutorial/blob/master/Finished%20Project/Assets/Scripts/Interactables/Interactable.cs
  55. VS Code's Copilot. (2024). How can I add an animation to a 3D model in the unity editor? I already have a FBX file with an Idle animation, and a FBX file with an animation skeleton. Well, how do I add the idle animation to the animation skeleton in the unity editor? Accessed on June 20th, 2024.
  56. ChatGPT 4. (2024). In my Unity project, I have a .controller file, which has the animations for a 3D model, and an FBX file, which has the Animation skeleton for a 3D model. Well, if I click on the FBX file in my unity editor, and then click on the "animation" tab, I don't see the clips for the animations for the .fbx file. I only see 2 checkboxes: "import constraints", and "import animation". None of the checkboxes seem to do anything. How can I add animation clips to the FBX file with my animation skeleton? Accessed on June 20th, 2024.
  57. Sebastian Lague. (2017, August 9). INTEGRATION 01 - Making an RPG in Unity (E03). YouTube. Retrieved from https://youtu.be/COckHIIO8vk?si=dR7lCjXE5HyLAcnT. Accessed on June 20th, 2024.
  58. Brackeys. (2017, June 27). CharacterAnimator.cs. In RPG-Tutorial. Retrieved June 21, 2024, from https://github.com/Brackeys/RPG-Tutorial/blob/master/Finished%20Project/Assets/Scripts/Anim/CharacterAnimator.cs
  59. Sebastian Lague. (2017, August 9). INTEGRATION 01 - Making an RPG in Unity (E03) [Video]. YouTube. Retrieved June 21, 2024, from https://www.youtube.com/watch?v=COckHIIO8vk.
  60. Brackeys. (2017, June 27). Stat.cs. In RPG-Tutorial. Retrieved June 21, 2024, from https://github.com/Brackeys/RPG-Tutorial/blob/master/Finished%20Project/Assets/Scripts/Stats/Stat.cs
  61. Brackeys. (2017, June 27). CharacterStats.cs. In RPG-Tutorial. Retrieved June 21, 2024, from https://github.com/Brackeys/RPG-Tutorial/blob/master/Finished%20Project/Assets/Scripts/Stats/CharacterStats.cs
  62. Brackeys. (2017, June 27). PlayerStats.cs. In RPG-Tutorial. Retrieved June 21, 2024, from https://github.com/Brackeys/RPG-Tutorial/blob/master/Finished%20Project/Assets/Scripts/Stats/PlayerStats.cs
  63. Brackeys. (2017, June 27). EnemyController.cs. In RPG-Tutorial. Retrieved June 21, 2024, from https://github.com/Brackeys/RPG-Tutorial/blob/master/Finished%20Project/Assets/Scripts/Controllers/EnemyController.cs
  64. Brackeys. (2017, September 13). ENEMY AI - Making an RPG in Unity (E10). YouTube. Retrieved from https://youtu.be/xppompv1DBg?si=CSNgYD33oE0m_LPu. Accessed on June 21st, 2024.
  65. Brackeys. (2017, August 22). EquipmentManager.cs. In RPG-Tutorial. Retrieved June 21, 2024, from https://github.com/Brackeys/RPG-Tutorial/blob/master/RPG%20Project/Assets/Scripts/EquipmentManager.cs
  66. Brackeys. (2017, August 25). PlayerManager.cs. In RPG-Tutorial. Retrieved June 21, 2024, from https://github.com/Brackeys/RPG-Tutorial/blob/master/RPG%20Project/Assets/Scripts/PlayerManager.cs
  67. Brackeys. (2017, August 25). Enemy.cs. In RPG-Tutorial. Retrieved June 21, 2024, from https://github.com/Brackeys/RPG-Tutorial/blob/master/RPG%20Project/Assets/Scripts/Enemy.cs
  68. Brackeys. (2017, August 23). EnemyStats.cs. In RPG-Tutorial. Retrieved June 21, 2024, from https://github.com/Brackeys/RPG-Tutorial/blob/master/RPG%20Project/Assets/Scripts/Stats/EnemyStats.cs
  69. Brackeys. (2017, August 25). CharacterCombat.cs. In RPG-Tutorial. Retrieved June 21, 2024, from https://github.com/Brackeys/RPG-Tutorial/blob/master/RPG%20Project/Assets/Scripts/CharacterCombat.cs
  70. Sebastian Lague. (2018, March 26). INTEGRATION 03 - Making an RPG in Unity (E12). YouTube. Retrieved from https://www.youtube.com/watch?v=yhPRkihs-Yg](https://www.youtube.com/watch?v=yhPRkihs-Yg. Accessed on June 23rd, 2024.
  71. VS Code's copilot. (2024). "In this c# code for my unity game, transform this line of code so that, isntead if being a dictionary with 2 keys, the weaponAnimationsDict becomes an array with just 1 key." Highlighted Line 17 in PlayerAnimator.cs. Accessed on June 24th, 2024.
  72. VS Code's copilot. (2024). "I mean, just transform this line of code so that, instead of storing stuff using 2 keys, it stores stuff by using just 1 key." Highlighted Line 17 in PlayerAnimator.cs. Accessed on June 24th, 2024.
  73. VS Code's copilot. (2024). "The "string" could be just a number (like starting from "0" and onwards). Would it be wiser just to use a regular array instead of a dictionary?" Highlighted Line 18 in PlayerAnimator.cs. Accessed on June 24th, 2024.
  74. VS Code's copilot. (2024). "Actually, I don't know the exact number of items that I will be storing into the weaponAnimationsArrray. Could you modify this so that I don't have to type the "numberOfWeapons" variable?" Highlighted Line 18 in PlayerAnimator.cs. Accessed on June 24th, 2024.
  75. Sebastian Lague. (2018, April 10). INTEGRATION 04 - Making an RPG in Unity (E13). YouTube. Retrieved from https://youtu.be/aOmqkTdqQXo?si=8p_8kT-LwjUv9XJF. Accessed on June 24th, 2024.
  76. Salinas, E. (2024). MazeLevelText.cs script from my own Dreadhalls project. GitHub. Retrieved from https://github.com/eduardoluis11/dreadhalls/blob/main/Assets/MazeLevelText.cs. Accessed on June 25th, 2024.
  77. Salinas, E. (2024). CoinText.cs script from my own Helicopter Game submission. GitHub. Retrieved from https://github.com/eduardoluis11/helicopter-gd50/blob/main/Assets/Resources/Scripts/CoinText.cs. Accessed on June 25th, 2024.
  78. psprices.com. (n.d.). Image of Final Fantasy VI for PS4 [Digital image]. Retrieved from [https://image.api.playstation.com/vulcan/ap/rnd/202303/1307/6d9a1b6e7a3fb192cc5f79407264fd2218d9516575bc4ffd.jpg?h=720] . Accessed on June 25th, 2024.
  79. VS Code's copilot. (2024). "@workspace /fix If I activate any of the snippets that say "text" or "Text" in my Unity game in Unity 2021, and then try to attach that script to a UI Text Game Object, I get the following error message: "Can't add 'Text' to Player HP UI because a 'TextMeshProUGUI' is already added to the game object! A GameObject can only contain one 'Graphic' component. ". How can I maniputlate the text from the UI Tet game object in Unity using the selected snippet from my script? The text game object is a "Text - TextMeshPro" object in my unity project." Accessed on June 25th, 2024.
  80. Pycharm's Copilot. (2024). Awesome, now, I want you to modify the selected line of code so that my UI text in my Unity game prints me the current health points of the player, as well as the max number of health points that the player has at full health. You need to concatenate tht to the side of the "Fang: " script. Where are the current health points and the max health points stored? In the CharacterStats.cs script. The current health points are stored in the "currentHealth" variable in the CharacterStats.cs script. Meanwhile, the max number of health points at full health are stored in the "maxHealth" variable in the CharacterStats.cs script. To call those HP related variables, first, the game calls the PlayerCharacterStats.cs script, which then calls the CharacterStats.cs script. But the variables themselves are in the CharacterStats.cs script. So, find a way to access the two aforementioned health point variables in the CharacterStats.cs script, insert them into my HealthUIText.cs script, and concatenate their values in the selected line of code. Highlighted Line 70 in HealthUIText.cs. Accessed on June 25th, 2024.
  81. Pycharm's Copilot. (2024). "Thanks! Now, I want to change the variable name of 1 variable in this script to make it more original. Which variable name would you recommend me changing so that it's less likely to produce buggy behavior in my Unity game?" Attached my PlayerMotor.cs script. Accessed on June 26th, 2024.
  82. Pycharm's Copilot. (2024). "Awesome. Now, change the name of one of the variables in this script to make it more original, but in a way that doesn't affect the rest of the files in my game." Attached my Stat.cs script. Accessed on June 26th, 2024.
  83. Pycharm's Copilot. (2024). "Change this variable's name to another one that better describes what this variable does." Attached my CharacterAnimator.cs script. Highlighted line 27 of my CharacterAnimator.cs script. Accessed on June 26th, 2024.
  84. Pycharm's Copilot. (2024). "Thanks. Now, change the name of one of the variables from this script to a more descriptive one, and make sure to select a variable that isn't used by other scripts and that won't make the game buggy if I change its name." Attached my CharacterCombat.cs script. Accessed on June 26th, 2024.
  85. Pycharm's Copilot. (2024). "Thanks. Now, do the same with this script: select a variable that isn't being used by other scripts, and change its name to a more descriptive name." Attached my Enemy.cs script. Accessed on June 26th, 2024.
  86. Pycharm's Copilot. (2024). "Look at all the variables inside this file. Well, select one, and change the name of the variable to a more descriptive one. Make sure that, if I change the variable name, that it won't make my unity game buggy." Attached my Interactable.cs script. Accessed on June 26th, 2024.
  87. VS Code's Copilot. (2024). "Thanks. Now, modify this line of code to add an additional condition that, if the scene is either 'GameOver' or 'Victory'. That is, add the additional condition that 'currentScene' could also be 'Victory'." Highlighted line 33 from my LoadSceneWhenPressingEnter.cs script. Accessed on June 26th, 2024.
  88. ChatGPT Omni (free tier). (2024). "I'm making an Unity game, and the UI text looks good on the Unity Editor. However, if I export a build for the game, the UI text will show up like this. The UI text that says 'Fang' should be on the upper left corner of the screen, whereas the 'Imanus' UI text should show up in the upper right corner of the screen. However, the UI text is at a lower position than it should be. I can see this exact mistaken position for both UI text elements if I click on the 'Play maximized' option in the 'Game' tab of my Unity 2021 Editor. The UI text elements look fine in the scene tab of the unity editor, and if I never play the game on 'play maximized', and if I never play any build for the game. So, could you tell me how to guarantee that the UI text elements will be shown at the correct position when playing a build of the game, and while playing on the 'play maximized' setting on my 'game' tab in my unity editor?" Uploaded an image showing the mistaken positions of the UI elements for the HP for both the player and the enemy. Accessed on June 26th, 2024.
  89. ChatGPT Omni (free tier). (2024). "Thanks. Now, when I play in maximized mode, and I go to the Title Screen of my Unity game (from Unity 2021), the text looks way smaller in the 'Play Maximized' mode of the Unity Editor, and in the Build version of the game than what it looks like in other screen sizes in the Unity Editor. The text looks too small. In the Unity editor, if I play using any other setting other than 'Play Maximized' in the 'Game' tab, the text looks big and good enough. It's in the 'Play maximized' mode and in the build version of the game where the text looks way too small and hard to read. How can I make the UI text to look bigger and easier to read in 'Play Maximized' mode and in Build versions of the game?" Uploaded an image showing that the UI text for the Title screen had a font size that was too small. Accessed on June 26th, 2024.

About

This is "Keith: Retrieving the Medal", my final project for Harvard's GD50 course. This is a 3D Unity game. "Keith" is copyright of Eduardo Salinas.

Resources

License

Stars

Watchers

Forks

Packages

No packages published