Try, try, and try again

I think at this point, I’ve watched almost all the somewhat current videos covering common intro Unity topics. This is most definitely an exaggeration but that is honestly what it feels like. I wanted to take advantage of this time to practice working in the Unity environment, while still pushing forward with developing our project. So I thought, adding the VR rig shouldn’t be too difficult… I knew Ryan put in a good chunk of work already in setting up our VR environment, but for some reason, I had a lot of trouble interacting with an object I created – a sphere.

My enemy of the week

The funny thing is that I went into this thinking the most difficult thing would be adding the ability to move and turn around the scene I created – only because that had a few different options! As in, do I want the player to teleport, should the controllers project the player’s potential movement, etc. (which, in the end, we decided it would be more immersive to have continuous movement, but I digress). However, as it turns out, that was as easy as adding a couple of components. Grabbing an item, on the other hand, had me struggling.

I wish I had thought to record what it looked like from the player’s perspective because I’m sure it looked ridiculous – like when you glitch through a map and end up in unknown areas in video games. Basically, every time I tried to pick up the sphere, I would try to move the left joystick to walk around while holding the ball, but then I would immediately get launched off the plane object. At first I thought it was a gravity issue. So first, I tested it by turning off the gravity for the sphere – the only difference being that the ball floated up once I let go of it instead of it falling. (Hindsight thought: well, duh!) I won’t bore you with the rest of the details, but after trying a bunch of different settings on several components on both the sphere and the player objects and many thorough readings of the properties of those components, I finally got it. To be honest, the Movement Type property of the XR Grab Interactable component should have been one of the first things I checked. It was set to “Instantaneous” so I’m thinking that the movement of the sphere was being transferred to the cube objects I set as controller placeholders. But hey, I’m learning, right? Now I’ll never forget it.

Note to self: Read all properties carefully

I have to admit, I did celebrate a bit once the scene was working as expected at that point. It might have been a tiny problem in the grand scheme of things, but considering the fact that I had no experience with Unity at all just last week, I’m feeling pretty dang good about it. Small victories can still be important ones, and for once, I’m not dreading trying again.

Print Friendly, PDF & Email

Leave a Reply

Your email address will not be published.