This is the relevant code
Gun.prototype.Shootytwo = function() {
for(i=0;i<this.pellets;i++)
{
if (this.app.mouse.isPressed(pc.MOUSEBUTTON_RIGHT))
{
this.bulletentitytwo.setLocalEulerAngles((Math.random() * this.accuracy) - (this.accuracy / 2), (Math.random() * this.accuracy) - (this.accuracy / 2), (Math.random() * this.accuracy) - (this.accuracy / 2));
}
else
{
this.bulletentitytwo.setLocalEulerAngles((Math.random() * this.inaccuracy) - (this.inaccuracy / 2), (Math.random() * this.inaccuracy) - (this.inaccuracy / 2), (Math.random() * this.inaccuracy) - (this.inaccuracy / 2));
}
this.bulletentitytwo.children.forEach((enabloid) => {
enabloid.enabled = true;
enabloid.setLocalEulerAngles(0, 0, Math.random()*360)
});
anglePos = this.bulletentitytwo.forward.clone();
anglePos.scale(this.range);
from = this.bulletentitytwo.getPosition();
result = this.app.systems.rigidbody.raycastFirst(from,anglePos.add(from));
if(result)
{
if(result.entity.tags.has(this.enemytag))
{
result.entity.translateLocal(0,-50000,0);
result.entity.sound.play("sound");
Grams += this.damage;
//Grams += ((Math.floor(Math.random() * 6)) + 1);
};
};
}
};
Currently it just translates the entity as a placeholder. Can anyone tell me how to have individual entity specific health and to lower it by a given amount?