Error when exporting tools as prefabs

When I attempted to follow this guide about making tool prefabs, I ran into an issue what when I imported the prefab after exporting it, I would find the prefab id would never populate.

I ended up having to open project.json manually and modifying the asset type from “scene” to “script”.

I don’t know why I needed to manually modify project.json, why it defaulted to importing asset.json as a scene, or why asset.json actually needs to be typed as a script, but that is all that I could do to solve the issue.

After performing this modification I was then able to use the prefab in scripts as normal.

Below screenshots showing the change I had to make:

2 Likes

While I am here, I’ll also add that the original guide gives the player the prefab on the CharacterDied event. That is not a valid method, as that gives the player to prefab as soon as they die, it doesn’t wait for a new character to respawn.

I’ve used some timers to wait about 5.5 seconds before re-adding the player to the queue but this is a perfect case where we probably need async stuff or a CharacterAdded event.