{"id":25,"date":"2022-01-21T06:40:44","date_gmt":"2022-01-21T06:40:44","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/codeblur\/?p=25"},"modified":"2022-01-21T06:42:55","modified_gmt":"2022-01-21T06:42:55","slug":"try-try-and-try-again","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/codeblur\/2022\/01\/21\/try-try-and-try-again\/","title":{"rendered":"Try, try, and try again"},"content":{"rendered":"\n<p>I think at this point, I&#8217;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, <em>adding the VR rig shouldn&#8217;t be too difficult<\/em>&#8230; 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 &#8211; a sphere. <\/p>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5219\/files\/2022\/01\/TestScene.png\" alt=\"\" class=\"wp-image-26\" width=\"483\" height=\"298\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5219\/files\/2022\/01\/TestScene.png 966w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5219\/files\/2022\/01\/TestScene-300x185.png 300w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5219\/files\/2022\/01\/TestScene-768x474.png 768w\" sizes=\"auto, (max-width: 483px) 100vw, 483px\" \/><figcaption>My enemy of the week<\/figcaption><\/figure><\/div>\n\n\n\n<p>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 &#8211; only because that had a few different options! As in, do I want the player to teleport, should the controllers project the player&#8217;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. <\/p>\n\n\n\n<p>I wish I had thought to record what it looked like from the player&#8217;s perspective because I&#8217;m sure it looked ridiculous &#8211; 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 &#8211; 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&#8217;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 <em>and<\/em> 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 &#8220;Instantaneous&#8221; so I&#8217;m thinking that the movement of the sphere was being transferred to the cube objects I set as controller placeholders. But hey, I&#8217;m learning, right? Now I&#8217;ll never forget it. <\/p>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"430\" height=\"278\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5219\/files\/2022\/01\/XRGrabInteractable.png\" alt=\"\" class=\"wp-image-27\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5219\/files\/2022\/01\/XRGrabInteractable.png 430w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5219\/files\/2022\/01\/XRGrabInteractable-300x194.png 300w\" sizes=\"auto, (max-width: 430px) 100vw, 430px\" \/><figcaption>Note to self: Read all properties carefully<\/figcaption><\/figure><\/div>\n\n\n\n<p>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&#8217;m feeling pretty dang good about it. Small victories can still be important ones, and for once, I&#8217;m not dreading trying again.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I think at this point, I&#8217;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. &hellip; <a href=\"https:\/\/blogs.oregonstate.edu\/codeblur\/2022\/01\/21\/try-try-and-try-again\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Try, try, and try again<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":12050,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-25","post","type-post","status-publish","format-standard","hentry","category-capstone-blog"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/codeblur\/wp-json\/wp\/v2\/posts\/25","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/codeblur\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/codeblur\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/codeblur\/wp-json\/wp\/v2\/users\/12050"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/codeblur\/wp-json\/wp\/v2\/comments?post=25"}],"version-history":[{"count":1,"href":"https:\/\/blogs.oregonstate.edu\/codeblur\/wp-json\/wp\/v2\/posts\/25\/revisions"}],"predecessor-version":[{"id":28,"href":"https:\/\/blogs.oregonstate.edu\/codeblur\/wp-json\/wp\/v2\/posts\/25\/revisions\/28"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/codeblur\/wp-json\/wp\/v2\/media?parent=25"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/codeblur\/wp-json\/wp\/v2\/categories?post=25"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/codeblur\/wp-json\/wp\/v2\/tags?post=25"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}