Open proggen-com opened 3 months ago
@TokageItLab Is this related to the root motion in animations problem?
@fire No, it is not relevant animation as the root motion is just a value. I do not know how the authors of the issue apply the root motion, but this is a physical area issue as long as it is applied as follows as I have wrote in the document:
func _process(delta):
if Input.is_action_just_pressed("animate"):
state_machine.travel("Animate")
set_quaternion(get_quaternion() * animation_tree.get_root_motion_rotation())
var velocity: Vector3 = (animation_tree.get_root_motion_rotation_accumulator().inverse() * get_quaternion()) * animation_tree.get_root_motion_position() / delta
set_velocity(velocity)
move_and_slide()
If the root motion is being added directly to the coordinate values, then the script is wrong.
Tested versions
System information
Godot v4.3.dev (0c6b5efab) - Windows 10.0.22631 - Vulkan (Forward+)
Issue description
When running against another physics object with CharacterBody3D with a skeleton and root motion animations the body gets stuck against other physics objects. Using a capsule as the main physics collider.
Looking into this a bit more it seems there are three places in move_and_slide() that can cause the horizontal velocities set to zero.
Removing these velocity assignments on those lines will fix the getting stuck. But the character will slip and slide.
Steps to reproduce
Run the test project and walk against the cylinder wall for some time.
Minimal reproduction project (MRP)
stuck.zip
https://github.com/godotengine/godot/assets/91064515/b66fef75-3144-4d61-822f-4b89d1a1cc9c