playMaker

Author Topic: Load Prefab by Name?  (Read 2424 times)

mathius777

  • Playmaker Newbie
  • *
  • Posts: 38
Load Prefab by Name?
« on: July 19, 2013, 03:42:12 PM »
Hey. I was wondering if it was possible to load a prefab by name in PM. I have a bunch of tiled "rooms" that are saved as prefabs(room001,room002,etc). I would like to load roomxxx when a trigger is touched, but I don't see any way to load a prefab in this way. The closest thing is of course Load Level, but then I would have to make everything a scene and worry about transferring global objects between scene loads. Any ideas? Thank you.

vidi

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Load Prefab by Name?
« Reply #1 on: July 19, 2013, 06:11:42 PM »
In the actionbrowser you can find in the tab GameObject create object .
I think that is what you are looking for

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Load Prefab by Name?
« Reply #2 on: July 19, 2013, 06:22:19 PM »
I think you'll need the Resources Load action here:
http://hutonggames.com/playmakerforum/index.php?topic=3916.msg19807#msg19807

This should let you load a resource by name, store it in a GameObject variable, then use Create Object to spawn it.
« Last Edit: July 19, 2013, 06:25:09 PM by Alex Chouls »