Hello, i’m tring to make the character fire an arrow, after fighting with the range weapon (so i will be able to change it based on weapon equipped later) i have used this code
shoot: function (event) {
this.state="attack";
this.model.animation.play("orc club attack.json", this.blendTime);
this.model.animation.speed = 0.5;
this.model.animation.loop = false;
this.arrow=app.root.findByName('arrow');
var arrow = this.arrow.clone();
app.root.addChild(arrow);
arrow.setPosition(this.entity.getPosition());
arrow.enabled = true;
this.force = new pc.Vec3();
this.force.copy(this.entity.forward);
this.force.scale(-this.impulse);
arrow.rigidbody.applyImpulse(this.force);
},
but it give me an error on the last line (arrow.rigidbody is undefined)…what did i do wrong?