#How to extract and play root motion with rival character?
1 messages · Page 1 of 1 (latest)
creature.CreatureComponent.ValueRW.MoveVector = creature.CharacterAspect.LocalTransform.ValueRO.TransformDirection(creature.CreatureComponent.ValueRO.LastRootMotion) / baseContext.Time.DeltaTime
;```
this is what i have tried
Using root motion with Rival would consist of:
- computing how much root motion delta happened since the last time the character updated (this depends on the animation approach you're using)
- if dealing with a root motion position delta, turn it into a velocity like this in your
HandleVelocityControl:characterBody.RelativeVelocity = positionDelta / baseContext.Time.DeltaTime; - if dealing with a root motion rotation delta, add it to the character's rotation like this:
rotation = math.mul(rotation, rotationDelta);