Yep, good questions.
The difference between these two is the top one is called a “pure” function. See how there’s no white execution line going into some nodes, but there is on other nodes? Any node without that line is “pure” - which is a setting you can toggle on by clicking the function name and turning it on in the details panel.
A “pure” function just means the function won’t change the value of any variables. It can make the code look a little more organized, but it’ll work fine either way.
Ah, yes - since your model is more complicated than the simple snake, there will be a few changes.
You can delete this section that automatically grabs the bones and puts them into the array, and instead just type their names in manually. You won’t need to add the names for the arms or the feet - just the names for each bone in the spine/tail.
Another possible difference is if the bones you want to move are spaced equally or not.
For the simple snake model, each of its bones are are spaced the same distance apart.
That distance is important to know, because we have to manually calculate the position for each bone on the spline. Since all bones are equally spaced, we can calculate that distance once, store it in “Distance Per Segment” and use that in our loop.
If the bones are not equally spaced, like above, then you’ll need to either calculate or manually type in the distance each bone is from the root bone- probably in a new array.
GetSnakeLength
may or may not be useful in that case. It’s getting the first and last bone to find the overall distance of the snake.
You could just type in the head and tail bone name in the
GetSnakeLength
function, but it’ll just depend on your model’s setup whether that’s useful or not for figuring out the per-bone distance from the root.
Yep, there will be some changes since your model has the more traditional skeleton setup. The ones I can think of are:
Since the bones from the pelvis to the head will be pointing forward, and the bones from on the tail should point backwards, you’ll need a different rotational offset per bone, probably another array. In the simple snake, I was able to just type in one number for the bones, since they’re all pointing the same way.
This part will also need to change. Here I’m multiplying the array index by that distance per segment to calculate how far the bone is from the root. If you have that manually typed in, you can just look it up in an array. Some of the distances will be positive numbers - for the bones from the pelvis to the spine, since those should appear in front of the root - and some will be negative - for the tail bones behind the root.
In this case, the main thing with ordering is to make sure that you have all these things in the same order:
- The list of bone names
- The distance each bone is from the root
- The rotational offset for that bone
Unfortunately, I’m not available for discord or a call - forum posts is the best I can do.
I’m rooting for you!