Holy mothe rof load...
Why am i cursed...
Checking the animation player, i noticed that in new rig case the vector is set wrongfully, than in the old rig..


You can see that in the old rig the vect3.z advances while in the new rig vect3.y
why!!!!???
EDIT:
Reimported and exported and reloaded godot and matched the export settings to the old rig, and now it shows correctly

But still in game the velocity vect is not correct.

Old rig kinda works fine if you look at velocity

EDIT2:
Well.. shit me bed almighty, changing the rootmotion code, works.. i dont understand whats going on and why, but all is good now..
Why is this so complicated??? This messes with my brain..
So i have move function that moves player when its in the walk state.
Old rig works with this.
func process(delta):
input_dir = Input.get_vector("k_left", "k_right", "k_forward", "k_backward")
direction = (player_camera.transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
if direction:
var up := Vector3.UP
#var forward := -direction
# For root motion
var forward := direction
var right := up.cross(forward).normalized()
var corrected_up := forward.cross(right).normalized()
var target_basis := Basis(right, corrected_up, forward).orthonormalized()
var a = transform.basis.get_rotation_quaternion()
var b = target_basis.get_rotation_quaternion()
var c = a.slerp(b,0.1)
transform.basis = Basis(c).orthonormalized()
else:
# For root motion
var _velocity = (anim_player.get_root_motion_rotation_accumulator().inverse() * get_quaternion()) * anim_player.get_root_motion_position() / delta
set_velocity(_velocity)
func move(move_speed:float, move_acc:float, delta:float) -> void: #ignore unused vars, just testing for now
# For root motion
var _velocity = (anim_player.get_root_motion_rotation_accumulator().inverse() * get_quaternion()) * anim_player.get_root_motion_position() / delta
set_velocity(_velocity)
New rig works with this.
func process(delta):
input_dir = Input.get_vector("k_left", "k_right", "k_forward", "k_backward")
direction = (player_camera.transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
if direction:
var up := Vector3.UP
#var forward := -direction
# For root motion
var forward := direction
var right := up.cross(forward).normalized()
var corrected_up := forward.cross(right).normalized()
var target_basis := Basis(right, corrected_up, forward).orthonormalized()
var a = transform.basis.get_rotation_quaternion()
var b = target_basis.get_rotation_quaternion()
var c = a.slerp(b,0.1)
transform.basis = Basis(c).orthonormalized()
else:
# For root motion
var _velocity = get_quaternion() * anim_player.get_root_motion_position() / delta
set_velocity(_velocity)
func move(move_speed:float, move_acc:float, delta:float) -> void: #ignore unused vars, just testing for now
# For root motion
var _velocity = get_quaternion() * anim_player.get_root_motion_position() / delta
set_velocity(_velocity)
So this gives you multiple ways to implement root motion velocity and rotation setting, https://docs.godotengine.org/en/stable/classes/class_animationmixer.html#class-animationmixer-method-get-root-motion-position i dont know why there are many different options, and in one case you need to use one method and in other other.. Maybe some XYZ types of you guys can maybe explain this if you care to do so 🙂
IDK how and why, but ill take it..
Atleast for now, this solves my struggles. And That Rigodify plugin for blender rigify, is very nice. Tho i had to modify it, to include the all transform constraints on bones, otherwise the scale property is not scaling the mesh. I need scale because it its easier to make breathing animation by just scaling the chesticle bone.
Works.. 🙂