Playmaker Forum
PlayMaker News => General Discussion => Topic started by: Handrews on December 02, 2020, 06:45:39 PM
-
Basically I need a way to find a Prefab on my Assets folder using his name and then store it into GameObject variable to use it on Create Object...
-
Use Resources Load with asset path, then store it as you like.
-
Yea but i need a way to find the prefab by name too
-
Ok i made it using Build String to create a path using the name stored in the variable...but now "Resources Load" seems to not be working or not recognizing the path (Assets/FireBolt1.prefab) and i don't know why...
-
Hi.
You need to place the things you want to load into a 'Resources' folder.
https://docs.unity3d.com/ScriptReference/Resources.Load.html
So for example if you have your fire bolt in a folder like this :
Assets/Some folder/Some subfolder/Resources/Bolts/FireBolt1.prefab
Then you would load it with "Bolts/FireBolt"
-
Nice! It works" Thx u very much! :)