I tried to experiment with procedural animation in Unity.
The idea came from this reddit post, and I tried to replicate this thanks to the explanation given in the post.
I used FastIK on the asset store to create the IK.
If you want to look at my work you can go to my GitHub repository.
The whole system works by checking distances between 2 points for each legs.
One point is parented to the body and it's height is constantly checked and adapted for the terrain.
The other one is the very end of the leg, the part that should be touching the ground.
One point is parented to the body and it's height is constantly checked and adapted for the terrain.
The other one is the very end of the leg, the part that should be touching the ground.
When the distance is too big between those two points, a buffer point gets the current position of the parented point, and the point of the end of the leg is moving towards the buffer position. I also give an initial height at the start of the movement to avoid it sliding on the ground.
So far I made it via 2 sets of three legs but it's not scalable. To do so I need to check the ground of each legs and move them appropriatly to give it the same feeling but with a changeable scale.
I also need to rotate the body based on the height of the legs as well as raise the entire thing to the maximum extent of the leg, with a bit of bending, that will be on the lowest ground.
I also made it so the spider looks for interactables objects in its surroundings.
Basically, each leg looks around itself to find an object in the distance of it's length. And if it's found, the leg goes to that object and activates it.
Now if the leg is too far from that object, it simply goes to the parented point linked to that leg.
I need to make some more checks, like only move the absolute closest leg and ignore every other ones.
For now this project is on hold. I haven't abandonned it and plan to return to it in the future.
I'm working on a game and other projects to learn more about some things I need to know to be a better programer, so I can't focus on this project for now.
I'm working on a game and other projects to learn more about some things I need to know to be a better programer, so I can't focus on this project for now.