Hi everyone, I’m facing an issue in my PlayCanvas shooter game where the weapon equipment logic is written, but the weapons are completely failing to load onto the player character during runtime.
Even though I have set up the weapons array and the code runs, the models don’t attach to the player’s hand and the console warns that the assets aren’t found or loaded properly.
Here is my weapons configuration:
JavaScript
this.weapons = [
{ name: "Knife", assetName: "Combat Knife Model", damage: 15, range: 2, fireRate: 0.5, ammo: Infinity, maxAmmo: Infinity, isMelee: true },
{ name: "Pistol", assetName: "Pistol Model (Tokarev)", damage: 25, range: 40, fireRate: 0.8, ammo: 12, maxAmmo: 12, isMelee: false }
];
What is the correct way to instantiate and attach these weapon models to a specific bone or child entity under the player via script once they are loaded from the assets? Any code examples or tips would be a huge help!