{"id":37,"date":"2011-12-07T14:03:01","date_gmt":"2011-12-07T14:03:01","guid":{"rendered":"http:\/\/mbackler.wordpress.com\/?p=37"},"modified":"2011-12-07T14:03:01","modified_gmt":"2011-12-07T14:03:01","slug":"setting-rigidbody-constraints","status":"publish","type":"post","link":"https:\/\/www.markbackler.com\/?p=37","title":{"rendered":"Setting Rigidbody Constraints"},"content":{"rendered":"<p>Thought this was going to be an unproductive lunch but I managed to find an easy way to lock the Z position and stop the cube from rotating about. You can also lock the rotation in each axis which solves the problem of the cube falling over:<\/p>\n<div id=\"attachment_40\" style=\"width: 532px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/mbackler.files.wordpress.com\/2011\/12\/lockingaxis1.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-40\" class=\"size-full wp-image-40\" title=\"LockingAxis\" src=\"http:\/\/mbackler.files.wordpress.com\/2011\/12\/lockingaxis1.jpg\" alt=\"\" width=\"522\" height=\"185\" srcset=\"https:\/\/www.markbackler.com\/wp-content\/uploads\/2011\/12\/lockingaxis1.jpg 522w, https:\/\/www.markbackler.com\/wp-content\/uploads\/2011\/12\/lockingaxis1-300x106.jpg 300w, https:\/\/www.markbackler.com\/wp-content\/uploads\/2011\/12\/lockingaxis1-500x177.jpg 500w\" sizes=\"auto, (max-width: 522px) 100vw, 522px\" \/><\/a><p id=\"caption-attachment-40\" class=\"wp-caption-text\">Setting Constraints<\/p><\/div>\n<p>I also found an\u00a0amended\u00a0version of the \u00a0example of the Unity\u00a02DGameplayTutorialProject Lerpz project here:\u00a0<a href=\"http:\/\/vonlehecreative.wordpress.com\/2010\/08\/26\/unity-resource-langmancontroller\/\">http:\/\/vonlehecreative.wordpress.com\/2010\/08\/26\/unity-resource-langmancontroller\/<\/a><\/p>\n<p>This strips out all the fluff and is just the useful movement bits. I&#8217;m going to try and learn from this to help me add jumping to my game, as if you just lift an entire script you never understand fully how it works, which will come back to bite you later on when you come to add more features or need to fix bugs with it.<\/p>\n<p>Another useful thing from this example is that it showed me what type of shader I need to add to utilise the transparency on my character PNG:<\/p>\n<div>\n<dl>\n<dt><a href=\"http:\/\/mbackler.files.wordpress.com\/2011\/12\/shader.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"Shader\" src=\"http:\/\/mbackler.files.wordpress.com\/2011\/12\/shader.jpg\" alt=\"\" width=\"463\" height=\"24\" \/><\/a><\/dt>\n<dd>Transparency Shader<\/dd>\n<\/dl>\n<\/div>\n<p>It also uses a plane instead of a cube for the character, which probably makes sense for me so I&#8217;ll switch this out later.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Thought this was going to be an unproductive lunch but I managed to find an easy way to lock the Z position and stop the cube from rotating about. You can also lock the rotation in each axis which solves the problem of the cube falling over: I also found an\u00a0amended\u00a0version of the \u00a0example of [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,17,25],"tags":[],"class_list":["post-37","post","type-post","status-publish","format-standard","hentry","category-constraints","category-locking-planes","category-rigidbody"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.markbackler.com\/index.php?rest_route=\/wp\/v2\/posts\/37","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.markbackler.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.markbackler.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.markbackler.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.markbackler.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=37"}],"version-history":[{"count":0,"href":"https:\/\/www.markbackler.com\/index.php?rest_route=\/wp\/v2\/posts\/37\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.markbackler.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=37"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.markbackler.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=37"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.markbackler.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=37"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}