Final Project: BuildSight
.png)
Assignment Brief
In this assignment, we need to complete a whole complete AR application based on our prototype and proposed idea.
Sharing Unity File
In week 11, I upload my unity file for Renee to use, but after she downloaded it, she cannot use it. I then need to figure out a way to share my file to her. She needs to share her file to me also. Thus, in week 12, I tried to do so.
I follow back the tutorial class, sharing filw using GitHub. In the last tutorial on doing these, because the file is too large, so we couldn't share it. We need something called Git LFS. I have already installed it. I follow back the step, to upload my unity file onto Git Hub. I successfully put it up into my Git Hub desktop, now I need to publish it. But because the file is too big, I couldn't publish it. My file name is ARtest2. It consists of the complete 3D building with materials applied on.
Following a tutorial online, I should initialize my Git LFS, after I already installed it. But I have a problem where the system cannot find my Git, the command prompt showed this:
C:\Users\kangw>git lfs install
'git' is not recognized as an internal or external command,
operable program or batch file.
Assets
I still need to prepare some assets, and we decide to change the button and panel looks. Renee has redrawn the new assets, I just need to change the colour for hover, and press button. Below are some of the new assets.
Besides that, I need to edit some photograph to use as the clues inside the application. I use Adobe Photoshop to these editing, like blurring the faces, adding filter, masking, and etc.
Applying texture
After I import in the 3D clue objects, it all appears white (without texture) or remain empty. So, I need to reapply the texture into it, using the same steps as I done it before. Create a material object, applying the material png into the material.
Minor change in quiz and clues
We decide to change the mode of quiz and clues.
1. Clue
- 3d clue object
- Individual clue panel
- Clue button
- All clue panel
We have 3d clue objects, the user can click it, and the respective clue panel will pop up. It will also unlock the clue object button in the all clue panel. Originally, we want it to be one room have 2 clues, and after collect the clues, the user needs to answer the quiz in that room. One room, two clues, one quiz. We think that this is too complicated and not that fun, so we change to just collect all the clues first, answer the quiz in the end.
2. Quiz
- Quiz Panel
- Result Panel
Now that we change to just quiz in the end, I don't need to use a quiz button anymore. User will only answer the quiz once they decide to exit the game. After user answer the quiz, there will be a result panel that shows the results of the quiz.
Pop-up Clue Panel
Function: When click on clue object, a clue panel will pop up.
Step 1: Box collider
Select the 3D object and add in box collider, tick the 'Is Trigger' function.
Step 2: Create the clue panel
Convert the image (assets) into sprite. Add in the panel using raw image ui elements, apply on the pre-made assets. Add in text and photo. Add a button to close the panel.
Step 3: Add script to button (button hovering + hit image change + sound)
Add the script below. In the inspector, under the button, change the transition from colour tint to sprite swap. Change the button image according to preferences.
Script:
Step 5: Add condition in the On click event
Step 6: Add sound when the clue object being picked up
Scripts:
Button sound
Step 1: Import Audio clip
Step 2: Add condition in the On Click event
In this week, we focus on combining our project files or share it. I also started to do the clue feature.
File Sharing
Renee and I try a lot of method to combine files, but it all ended up failing. In the last week, I try to use GitHub to share the files, but Renee couldn't open it due to cannot download LFS and more reasons. Then, Renee tries to use Unity Cloud to share the file to me. We both register the Unity account and Renee upload her file for me to use. She adds me as a collaborator, but I can't open the file too. It shown missing files. So, in the end, we ask for help from our lecturer. During the next class, Renee manages to discuss with the lecturer to solve this problem. I didn't attend the class due to some issues. Finally, lecturer, Mr. Razif, use his own account and add us as collaborators. Both of use managed to open and use the files now.
Clue Panel Pop up + Interaction with 3D objects
After import the 3D clue objects into the main file, I first need to create box collider for every one of them. Tick the is trigger button. Edit the box collider to fit the size of 3D objects.
Next, add in the scripts that I have done before.
Assign the individual clue panel to the 3D clue objects in the inspector.
We have decided to take out the count the click of the clue objects, to record whether the clue is being clicked or not. Because right now, we have a clue button at the bottom of the UI, where user can always review all the clues they collected. Thus, there's no need for counting the clue objects collected, we have a better system to review the clues.
Clue Panel
I have created the clue panel last week and test out the function, buttons and etc. In this week, I duplicate it and apply all of them to all of the clue objects. I also connect them with the clue buttons, clue panels to allow the features I mentioned before. There is a lot of them, but luckily, I have all the images and description ready before I do this, it speeds up the process. The panels consist of 5 elements only: a panel, a title, an image, a description and a back button.
Clue Button + All Clue Panel
I have created a clue panel that consists of many buttons to open up different clue panels. The button will only be unlocked when the clue is found (clicked).
Clue Manager
For the clue panel, clue button and all clue panel, I need them to be linked together because they are affected by each other. Thus, I need script to do it, it is named as ClueManager. The script is way too long so I won't paste it here. Basically, I use hide/shown method to hide the button or panel i want it to be hidden when another panel pop up, this is to prevent overlapping issues. But this takes a long time to do so, because I have so many different panels.
Initially, I tried to hide it one by one using on click event, but this turn out false, it doesn't work as there might be too much panels. So, I need to use scripts. In the scripts, using hide/shown method and array, I manage to hide and show panels. I just need to assign each of the panels and buttons in the inspector in order for it to work.
For the lock/unlock feature, I add in more scripts in the same script. The logic is: using if/else method, if the 3d clue object is clicked (unlocked), the clue button will be unlocked, else, it would be locked. Again, there is a lot of buttons, so I need array function again to assign all the buttons in the inspector to connect all the components together.
Quiz Panel
First, I create all of the quiz panel with all the options button with different answers. There is 5 quizzes in total. I just need to create one panel to be used and using scripts to add in more questions and also to define the correct and wrong answer, and finally to calculate the results.
Quiz Manager
Using the QuizManager script, I manage to change the questions and answers, decide the correct and wrong answer and finally, calculate the correct answer. I just need to write down the questions and answers, type in the correct answer index. I also able to use sprite swap and add in audio to allow the option button change colour, to indicate correct and wrong answer.
Result Panel
I create the result panel, apply the quiz manager scripts assign the title text, score text (to allow calculating and displaying the score) and also the buttons. I also need to assign what will appear next after hitting the End button. In the quiz manager scripts, I already apply the logic where the score will be calculated and shown.
Parts of scripts in QuizManager (for result panel):
Ending panel
I need to create an ending panel and add in scrolling animation and manual scrolling. After I create the panel and add in the storyline. I connect it with the quiz manager and also the exit. But I didn't manage to do the scrolling, both of them, so I ask for Renee's help, she managed to do the manual scrolling. We decide that the scrolling animation is not that important, so we didn't do it.
Exit
For the exit feature, I have an exit button - X button and also an Exit scripts. The scripts allow the exit panel to pop up and lead to quiz panel or ending panel. I need to assign the exit button and all the panels in the inspector.
Background Music
Adding the background music is easier. I follow a tutorial online to do this. In order to add in background music, I need two components, I need an Audio Manager and also a Music Start scripts.
Audio Manager:
Scripts:
Final Product
Google Drive link:
Throughout this assignment, I have learned a lot about Unity, building assets and teamwork. This is a very time-consuming project which required a lot of works and it requires different skills. I think that this is a great opportunity for me to polish my skills, like 3D modelling, photo editing, coding, be more familiar with Unity. This time, I also learn different methods to share project files, which will be useful in the future when I need to work in a team project. I face several challenges too. The first one, of course is about file sharing, it took us a long time to finally share a file together. In the meantime, I think Renee and I have learn a lot of different file sharing methods, so it was not all for nothing, we managed to learn something during the process too.
I face a lot of problem while creating the scripts, as I am not really got at it. I watch several tutorials to complete it. For the scrolling, I watch several tutorials, creating different version of scripts and panels, but still I can't make it work. So, in the end, I ask for help from my teammates, Renee, she successfully create the scrolling parts and solve our problem. I am very thankful for having a helpful teammate who have a really good technical skills in Unity. For some parts, she guide me to create the logic. She also gives a lot of advice on how to improve the application. Unfortunately, I cannot really make everything work, but I did my best to make the application features work.
In the end, I would like to thank our lecturer, Mr.Razif, who guide us through the whole semester and always be there when we need help. I am also very grateful for my teammate, Renee, who give me support and guide me through this assignment. I think that this is a great journey overall and I will keep improving my technical skills.
.png)
.png)
.png)
Comments
Post a Comment