Some of the bones face forward, some face backwards
The bones are not equally spaced.
Made a few changes to the blueprint logic:
Biggest one: Now we go through the skeleton on BeginPlay, and calculate the positive or negative distance from each bone to the root. You’ll need a new float array variable of BoneDistances, as well as a new variable for RootBone that you fill in with the RootBone’s name.
– The way I’m doing it here assumes the mesh will be initially placed looking down the X axis.
When positioning the snake, rather than using the array index to calculate the distance to place the bone, we just use it to index into the array of stored distance values.
Now that I’m treating the pelvis of the snake as the root, there’s a little extra code you have to do for when the spline wraps around - it’s the piece with the modulo (%) node.
Hey @JoeProgram
Thank you so much for helping me with the Chinese dragon animation. Because of less time, I am using the stretched model for now, but after finishing the project, I will look at the Blueprint code you shared and try to learn and make it better.
My main focus is on the car and the dragon face, so I think the pelvis stretch will not be noticed, especially because the environment will be very dark.
Thanks again for helping me out. I am really grateful for your support. Please keep helping newcomers like me it means a lot!
Hm… I’m not sure why the tail is flickering. The new blueprint code I posted doesn’t have that problem, so my guess is the flickering is due to some math error putting the tail bones different spots each frame.
@JoeProgram
This is with New code , you can see the tail flickering is still happening , the rotator and bonedistance i have enterd a temporary values in that
edit:- Now i have changed plan of the spline path , i will make it as if the tail will not come in the frame