Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Matthew Goulart |
Hey guys. I’m learning godot and so far it’s been a delight!
I am wondering how I can go about getting my player character to move.
My “character” scene is set up as follows:
low_poly_guy
= Armature
== Skeleton
=== Mesh
= Animation Player
= Animation Tree
= Root Motion View
= Kinematic Body
== Collision Shape
The animation tree is correctly set up, I know this because the Root Motion View moves according to the position of my character’s hips. This is a combination of mixamo animations exported with blender BTW.
So I save this scene and add it to my level, and then attach this script:
extends Node
func _input(event):
if event.is_action_pressed("ui_up"):
$AnimationTree["parameters/speed/blend_amount"] = 0
var xform = $AnimationTree.get_root_motion_transform()
$KinematicBody.move_and_slide(Vector3( 0, 0, 1))
if event.is_action_released("ui_up"):
$AnimationTree["parameters/speed/blend_amount"] = -1
So the animation plays properly, but the character doesn’t move at all.
Any thoughts? Thanks!