What I mean by the topic is, if the player is going to the right while camera is facing forward, the legs will shuffle from left to right in the direction of movement. I have good knowledge of scripting, but I have no idea how to go about doing this.If anyone could help me out or steer me to the right direction, that would be great!
I’m not looking for inverse kinematics, i’m just looking for a way to manipulate the R15’s hips to the direction of movement.
I don’t understand what you mean by this?
Can’t you just animate the hip to move to the way you want it too move too? It requires no scripting. You don’t script animations if your wondering you use a plugin to animate.
You could create different animations for each movement pattern:
- North
- South
- East
- West
- Northeast
- Northwest
- Southeast
- Southwest
From here, you calculate the direction of movement relative to the direction of the player('s camera) and play the animation correlating to that movement direction.
Now the question remains on how to calculate movement direction, which I have absolutely no clue how to do.
You can possibly do this with some trigonometry on Velocity and Root Joint manipulation.
ex: Get the angle using trigonometry, get the difference from camera angle and torso angle, rotate root joint according to that difference
To know which direction the character is moving, you could find the angle between the HumanoidRootPart.CFrame.LookVector and the Humanoid.MoveDirection using dot product.
What do you mean by dot product?
I want to use just one running animation to do this, I don’t think its efficient to make so much animations for this. I know it is possible to do this, because I have seen it been done on the default R6 walk animation.
This doesn’t have an impact on efficiency, simply the steps it takes to achieve the process. I personally think it’d be even more difficult to attain with R6 as it involves manipulation of a Motor6D’s Transform property or externally influencing JointInstances, over a new set of animations that just takes a directional value to determine which one to play.
Manipulating the transform property is exactly what I’m doing now in my personal project. This is something that I would defiantly recommend to you @AyeJude if you have a lot of patients and some knowledge of CFrames.
It also allows for some very dynamic animations, using the idea of inverse kinematics to make procedural and more realistic animations.
I’ll look further into this, Thanks!