- Home /
Scripts named 'Grenade.js' exist in multiple locations
Hello,
I have a free FPS kit from OneManArmy. And what I did is I imported the locomotion prefab of the soldier in the Bootcamp demo Project into this fps kit project.
Then suddenly, these 2 errors appeared:
Scripts named 'Grenade.js' exist in multiple locations (Assets/Scripts/weapons/Grenade.js). Please rename one of the scripts to a unique name.
Scripts named 'Grenade.js' exist in multiple locations (Assets/Resources/OldScripts/WeaponScripts/Grenade.js). Please rename one of the scripts to a unique name.
I tried to delete, or rename each one but more errors appeared.
So what should I do to fix this ?
Answer by DaveA · Jan 31, 2014 at 07:08 PM
Sounds like two systems used the same name for scripts which do different things. You would need to delete all scripts related to the one you deleted, or change the name of one grenade script, then fix all the places in scripts that depend on it to use the new name.
Ok I renamed one of the scripts to grenade2. And then an error appeared saying:
Assets/Scripts/weapons/Gun.js(269,82): BCE0004: Ambiguous reference 'Grenade': Grenade, Grenade.
And this is the code:
var grenadeObj : Grenade = projectile.GetComponent("Grenade") as Grenade;
grenadeObj.soldierCamera = soldierCamera;