{"author_name":"recursive frog","cat":"LD #22","comments":[{"author_name":"Shigor","time":"December 17, 2011 1:38 pm","epoch":1324147080,"text":"What are you using for character? If you&#8217;re using character controller, take a look at the &#8220;skin&#8221; setting <img src=\"http:\/\/ludumdare.com\/compo\/wp-includes\/images\/smilies\/simple-smile.png\" alt=\":)\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/>","spam":"N"},{"author_name":"dr_soda","time":"December 17, 2011 2:00 pm","epoch":1324148400,"text":"Hey there!","spam":"N"},{"author_name":"Shigor","time":"December 17, 2011 4:19 pm","epoch":1324156740,"text":"For a simple platformer Character controller is probably better choice, although it does have it&#8217;s problems. If you&#8217;re using normal rigid bodies, check what colliders you&#8217;re using. Sometimes changing collision type to continuous (you can afford it for simple objects) can help a lot (collision testing is a bit&#8230; actually not very accurate :).","spam":"N"}],"epoch":1324146780,"likes":0,"metadata":{"p_key":"61471","p_author":"recursive frog","p_authorkey":"504529","p_urlkey":"97236","p_title":"(-o^_^)-o HugMonster Wrestles with Unity3D\u2019s Physics","p_cat":"LD #22","p_event":"LD22","p_time":"1324146780","p_likes":"0","p_comments":"3","p_status":"UPD5","us_key":"504529","us_name":"recursive frog","us_username":"recursive frog","event_start":"1323993600","event_key":"8","event_name":"LD22"},"text":"<p>I&#8217;ve written physics engines before, though they were mostly simple affairs, and because I wrote them I have a pretty decent understanding of why they do what they do and how their limitations work. \u00a0Unity&#8217;s physics engine, being one that I did not write myself, is a little more opaque at the moment. \u00a0It buys you a lot right out of the box, such as gravity and velocity, and the ability to apply forces and torques. \u00a0Where the engine&#8217;s benefits are a little less clear is this particular 2D platformer.<\/p>\n <p>When using Unity physics, the documentation recommends that you use only velocity to move objects with colliders and rigidbodies, rather than translating the transform.position directly. \u00a0Okay, fair enough. \u00a0I dig that. \u00a0I do that sort of thing too, updating world space and translating to pixels. \u00a0What&#8217;s a little less clear though is why collisions against walls are as goofy as they seem to be. \u00a0I&#8217;d like to simply have characters, when they jump while pressing into a solid wall, to actually reach the full height of their normal standing jump before falling, but colliding with velocity into the side of a box collider adversely effects the y velocity so the jump is simply not as high as it &#8220;should&#8221; be.<\/p>\n <p>On the one hand I would really rather not re-implement physics if I can at least fake Unity&#8217;s physics into working well. \u00a0On the other hand, I. Just. Want. It. To. Work. Like. I. Expect.<\/p>\n <p><a href=\"http:\/\/www.ludumdare.com\/compo\/2011\/12\/17\/o_-o-the-hugmonster-commeth\/demo000\/\" rel=\"attachment wp-att-89102\"><img class=\"alignnone size-medium wp-image-89102\" src=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2011\/12\/demo000-300x169.png\" alt=\"\" width=\"300\" height=\"169\" srcset=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2011\/12\/demo000-300x169.png 300w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2011\/12\/demo000-550x310.png 550w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2011\/12\/demo000.png 976w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>","time":"December 17th, 2011 1:33 pm","title":"(-o^_^)-o HugMonster Wrestles with Unity3D\u2019s Physics"}