Procedural Animation - This Spider can climb anywhere! Unity3D Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey there it's leo welcome back for another video before starting i just wanted to tell you that i made a webgl build of my last video script so that you can try it online and even download the mesh you generate i'll put the link in the description obviously [Music] today i'm gonna explain you how i improved my spider procedural animation and the spider controller that comes with it as a quick reminder and for those who haven't seen the first video this is the result we had it's a fairly decent result but i'm not pushing too much the spider there it's not trying to climb any vertical walls or even ceilings so it's not very realistic for spider to only walk on flat ground and this is what we're going to improve at this video in the previous controller we were using a sphere collider with a rigid body and the gravity made us stick to the ground and we were moving forward backward or sideways by just adding forces to the rigid body this approach is very often used but for heavy objects or creatures spider is really light and we can actually ignore its weight and focus more on the way it sticks to any kind of surface [Music] the first idea i had was to use raycast instead i found it pretty elegant to make the spider scan what's around to adapt its orientation and position i used the icosahedron formula to cast the rays homogeneously around the spider [Music] as you can see it works just perfectly okay just kidding you know what let's change the approach instead of scanning around the spider let's try to scan underneath the spider only it will save some raycasts and it will be more accurate after updating the script i can change the number of rays directly within the editor and they are all cast following a circular shape and facing the spider's downward direction i'm actually tilting this downward direction to make sure i can handle any kind of squared angle edge [Music] and as you can see after a few adjustments it was looking great [Music] the only problem i see there is that the spider is actually brushing onto stiff surfaces and it's not looking very nice i solved this problem by doing two categories of ray casts one is father from the spider and will just effect on the orientation and the closest one will be for the body position this way the spider will look like it's actually anticipating the relief by moving toward steepness but it will just affect the body orientation and not the position so we will get rid of this rushing effect when it comes to steep hearts and as you can see it's working great i'm really happy with the result but i think we need to test it on a more spiderish playground [Music] there's still a few troubles but hopefully on the controller side they can be solved just by playing around with a few parameters [Music] the only problem remaining is from the procedural animation script and not from the controller as you can see the controller is pretty smooth and you can go pretty much everywhere but sometimes the legs are not touching the ground or they're going through the meshes [Music] the reason for that is that we just use one raycast per leg and it's completely vertical in the spider space i could increase the raycast range to increase the chances of getting a raycast hit but that's not solving the problem that's just a way of hiding it what i suggest is to make two of them and to add a bit of eccentricity compared to the perfect downward direction this way it will handle most of the common cases and as you can see it's working fine i really like the way it climbs onto 90 degrees angle walls so that's it for this video i hope you liked it i'm really happy with the result and i hope you are too [Music] [Music] [Music] you
Info
Channel: Léo Chaumartin
Views: 42,375
Rating: undefined out of 5
Keywords: Procedural Animation
Id: AhywDyu0EGw
Channel Id: undefined
Length: 7min 56sec (476 seconds)
Published: Mon Mar 29 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.