Skip to content

Commit

Permalink
Fix animations
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo committed Oct 3, 2023
1 parent 5ea4a1b commit 0ee677d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/bit-systems/behavior-graph/animation-nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,11 @@ const createAnimationActionDef = makeFlowNodeDefinition({
const rootEid = graph.getDependency<EntityID>("rootEntity")!;
const world = graph.getDependency<HubsWorld>("world")!;
const obj = world.eid2obj.get(rootEid)!;
const targetObj = world.eid2obj.get(targetEid)!;
const mixer = MixerAnimatableData.get(rootEid)!;

const action = mixer.clipAction(AnimationClip.findByName(obj.animations, clipName));
action.blendMode = additiveBlending ? AdditiveAnimationBlendMode : NormalAnimationBlendMode;
const blendMode = additiveBlending ? AdditiveAnimationBlendMode : NormalAnimationBlendMode;
const action = mixer.clipAction(AnimationClip.findByName(obj.animations, clipName), targetObj, blendMode);
action.setLoop(loop ? LoopRepeat : LoopOnce, Infinity);
action.clampWhenFinished = clampWhenFinished;
action.weight = weight;
Expand Down

0 comments on commit 0ee677d

Please sign in to comment.