For my game I wanted to create a 3D platformed of some kind. I initially went in pretty flexible about what I wanted it to be able to do as I didn't know how difficult or not it was going to be. I eventually settled on creating my Cowboy Platformer. All I really knew going in was some of the mechanics of Unity, such as lighting, the camera and creating simple objects like boxes.
My first problem was finding an asset for my Third Person Controller. I rummaged through the Unity standard assets and found a controller to use that worked well, but I didn't much like the model that it came with. So I then went to the unity asset store and grabbed a cowboy asset and found some western theme assets too. I thought making my cowboy move would be easier. At first I attempted to put the Third Person Controller onto my cowboy but it didn't work. After quite a bit of looking around the internet for help, I instead removed the standard model from the Third Person Controller and put my Cowboy's model onto it. Well now he could move, but he was not animated. So after more research and vain attempts, I tried putting one of the cowboys assets on the controller as well, his avatar. Well now our boyo was moving.
I had to have some thing for my cowboy to interact with in the game so I put various objects from the western assets folder into the game. Sadly they could not collide and I had to make them capable of such. I searched the components menus and found various colliders for my objects that I could use and also gave them rigid bodies so my Cowboy could push them around and jump on them. I also gave him a ground to walk on that he nor anything else would fall through.
After organizing these objects, I got to the harder parts. I decided I wanted my Cowboy to collect some coins and to give him a UI so he knew how he had. This part was rather difficult and took a lot of time to research and a little bit of frankensteining from practice code we had written in Unity. I had to make it so that not only did he collect the coins in a way that made the coins dissapear, but display that he had them. I also made the coins spin around : )
My first problem was finding an asset for my Third Person Controller. I rummaged through the Unity standard assets and found a controller to use that worked well, but I didn't much like the model that it came with. So I then went to the unity asset store and grabbed a cowboy asset and found some western theme assets too. I thought making my cowboy move would be easier. At first I attempted to put the Third Person Controller onto my cowboy but it didn't work. After quite a bit of looking around the internet for help, I instead removed the standard model from the Third Person Controller and put my Cowboy's model onto it. Well now he could move, but he was not animated. So after more research and vain attempts, I tried putting one of the cowboys assets on the controller as well, his avatar. Well now our boyo was moving.
I had to have some thing for my cowboy to interact with in the game so I put various objects from the western assets folder into the game. Sadly they could not collide and I had to make them capable of such. I searched the components menus and found various colliders for my objects that I could use and also gave them rigid bodies so my Cowboy could push them around and jump on them. I also gave him a ground to walk on that he nor anything else would fall through.
After organizing these objects, I got to the harder parts. I decided I wanted my Cowboy to collect some coins and to give him a UI so he knew how he had. This part was rather difficult and took a lot of time to research and a little bit of frankensteining from practice code we had written in Unity. I had to make it so that not only did he collect the coins in a way that made the coins dissapear, but display that he had them. I also made the coins spin around : )
Code For Collecting Coins and UI display
Coin Spinner
After this I created a new scene to serve as a new level. I had to create a few different prefabs for the Third Person Controller and UI and a few other things and reset the tags on all the object to be their correct tags again. After making sure everything worked and throwing a few coins in there, I needed to figure out how to switch from inside my building to outside of my building. It turned out to be similar code to my previous colliders. It basically made it so when I touched a specific object it would switch scenes and I would be in the new scene.
Door code ( I switched the code around to go through the other scene. I had 2 door programs
The last thing I made was a simply array that grouped my various objects in the outside scene. It didn't do anything other than organize really.
Object Array
Some thing I had intended to do was make my coins a global variable or object so that your coin count would carry over between scenes I honestly just didn't understand unity or C# enough to do this. I also would have liked to make my cowboy able to pick up and carry objects around and place them back down, but again I didn't know what to do at all.
There were a few problems at the end that I didn't know how to solve. Every so often when the cowboy changed scenes, he had lost his ability to be animated. There was a lighting problem for a while, but In the end I just had to change the angle of the lighting to fix it. The coin count also got a bit broken in the indoor scene and again I have no clue why.
There were a few problems at the end that I didn't know how to solve. Every so often when the cowboy changed scenes, he had lost his ability to be animated. There was a lighting problem for a while, but In the end I just had to change the angle of the lighting to fix it. The coin count also got a bit broken in the indoor scene and again I have no clue why.