From 28b04fcb4094d6a8df0d4b563d7b57bfd34e7988 Mon Sep 17 00:00:00 2001 From: kris temmerman Date: Tue, 28 Nov 2023 15:27:07 +0100 Subject: [PATCH] animes --- frontend/src/CharacterHandler.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/CharacterHandler.ts b/frontend/src/CharacterHandler.ts index 5e759a77..7035c53c 100644 --- a/frontend/src/CharacterHandler.ts +++ b/frontend/src/CharacterHandler.ts @@ -113,8 +113,9 @@ export default class CharacterHandler { this.tl.to(this.charPos,{"x":this.floorPos.x,"y":this.floorPos.y,"z":this.floorPos.z,duration:duration ,ease: "none"},pos) pos+=duration; - - this.tl.call(()=>{ this.animationMixer.setAnimation("idle",0);},[],pos) + let nextAnime = "idle" +if(Math.random()>0.7)nextAnime ="bored" + this.tl.call(()=>{ this.animationMixer.setAnimation(nextAnime ,0);},[],pos) this.tl.to(this.animationMixer,{"mixValue":1,duration:0.5,ease: "none"},pos) this.tl.to(this,{"characterRot":0 ,duration:0.5,ease: "none"},pos)