Simple Obstacle Avoidance System

<h2>|| Introduction to the problem</h2> <p>Hi and welcome, I should preface this by saying that the mathematics going into this post has been simplified for easy understanding and proving formulae and theory is not going to be talked over.</p> <p>Welcome to another post, I&rsquo;ve been meaning to talk about this for a while but havn&rsquo;t had the time to write it down. Along the development process of my game (Primal Dominion: Aftermath), I found myself questioning whether or not it was a feasible idea to incorporate procedural animations based on obstacles and structures in close proximity to the player. I devised a simple function that would do a sphere cast and I would determine an avoidance angle which would drive the upper body of the character away from the wall.</p> <p><img alt="" src="https://miro.medium.com/v2/resize:fit:600/1*bMYOdtEmehNWY5ELGNSwyg.gif" style="height:338px; width:600px" /></p> <p>I generally wasn&rsquo;t too sold on this idea as I felt like it was counter intuitive when playing, it gave the illusion of the dinosaur moving away and thus I would be convinced I am moving away and would end up colliding with walls thinking I would be safe. This insipired to me to rethink the system and incorporate it into a much more meaningful feature.</p> <p><a href="https://harrisbarra.medium.com/simple-obstacle-avoidance-system-ac88d61f31a6"><strong>Read More</strong></a></p>