Week 18

During the week, I finished my XR project.

Since I didn’t save my cat and pet bed assets from blender onto OneDrive before, I made sure to upload them there before I went in this week. In order to open the files, I also needed to download unity on my home PC. Once I did this, the models were able to be imported.

I worked on adding a script to my gun, I recolored its prefab asset inside of unity to give it a more personalised look. I had some trouble implementing the gun, as I added too many box colliders which collided with each other and caused some positional issues when I tried picking it up in VR. To fix this, I made sure the box collider and the rigid body was only on the parent of the gun instead of the gun model itself.

I managed to get my script working for the gun shooting! I had a lot of trial and error with the launchSpeed variable, and on top of this I originally forgot to set gravity to my ‘bullets’, but afterwards I was happy with them. I took inspiration from my bubble class, except I wanted my bullets to travel faster than my bubbles — So i made sure these differences were reflected in each script.

I also added an audio source when the gun is shot, as I find this adds immersion into the scene. This sound sounds a bit fantastical, which is to fit the gun that I make. My gun shoots stars so I wanted the sound to fit this.

Originally, I was trying to add a door as I got inspired by the cabinet doors in the VR create with me tutorial. As I noticed that the size of room that I have been playing around with was rather limited, I wanted to expand it with a door that can open out to reveal a larger area. I used this tutorial to help give me a further understanding of how hinge joints work. Make VR DOORS IN UNITY. However, after looking at several tutorials on the same topic and trying to apply this to the door in my scene — I didn’t manage to make it work. I decided to work more on features inside my room such as my interactable cat model and my gun as I felt it was a better use of my time.

I had to replace all the interaction for my cat and its sockets as they were deleted earlier and needed to be uploaded again, but I was happy when I got it working and now my cat meows when I put a hat on its head.

If I had more time, I would’ve focused more on the door. But since I didn’t have a plan for what would be reavealed outside of the door, I felt that it was a lower priority in development.

Leave a Reply

Your email address will not be published. Required fields are marked *