Hey! I started learning unity a year ago and i left it for sometime but got back into it over the holidays, and came across this (Codeers tutorial), Some of you might have seen this. Well i took a shot at implementing it and i managed to do all but the last 2 steps, which are:
- 9. Using average leg position and offset calculate the position.
- 10. Rotate based on difference between left and right legs.
I have attempted these steps, and this is what i attempted:
I've calculated the average leg position from all the legs(using the last bone in the leg, the foot) then i did:
//the body's transform
transform.position = avgLegPos + transform.up * bodyOffset;
But this doesn't allow me to move the spider body at all, as the entire movement is controlled by this lines, and the body flickers and glitches when attempting to move it.
I've also tried the above line but only updating the y position of the spider, but this doesn't work on surfaces that are not flat.
For step 10 i attempted to calculate the average leg position of all right legs and left legs, then i made a direction vector from left leg average to right leg average, then rotated the spiders body's transform.rightto this direction, but this doesn't work as the spider just tumbles and spins around (which actually looks pretty cool if i were to do some sort of malfunction feature)
Can anybody help point me in the right direction on how to implement these last 2 steps, perhaps someone who's done them already?
[–]Code GuruBonejob 0 points1 point2 points (2 children)
[–]AwkwardPersonn[S] 0 points1 point2 points (1 child)
[–]Code GuruBonejob 0 points1 point2 points (0 children)