pipd0un Posted May 10, 2021 Share Posted May 10, 2021 I'm trying to make a turn based rpg scene with 3d models. I got glTF exports from blender and their animations from mixamo. I've a constructor like; constructor() { this.clock = new THREE.Clock(); this.scene = new THREE.Scene(); this.loader = new THREE.GLTFLoader(); this.mixer; this.mixerEn; this.fog = false; this.animations = ["Idle", "Kick", "Stun"]; this.animationsEn = ["IdleSaf", "HitSaf"]; this.actions = []; this.actionsEn = []; this.init(); this.animate(); } then loaded models and their animations; loadModels() { // main model this.loader.load('glb/Es.glb', (object) => { this.mixer = new THREE.AnimationMixer(object.scene); object.scene.position.set(-250,0,0); object.scene.rotation.y = Math.PI / 2; if (object.scene.isMesh) { object.scene.castShadow = true; object.scene.receiveShadow = false; } this.scene.add(object.scene); this.loadAnim(); }); //opponent this.loader.load('glb/Es.glb', (object) => { this.mixerEn = new THREE.AnimationMixer(object.scene); object.scene.position.set(250,0,0); object.scene.rotation.y = -Math.PI / 2; if (object.scene.isMesh) { object.scene.castShadow = true; object.scene.receiveShadow = false; } this.scene.add(object.scene); this.loadAnimEn(); }); } the problem is main character's kick pass though opponents stomach, want to detect that so I can play a stun or fade animation for opponent. Most of collision methods for basic meshes like sphere and cube. I dont know what to do. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.