Jump to content

Recommended Posts

Posted

Does anyone know if there is a way to tell what prefab an entity was created from? Like the actual path and pfb file or do I need to track that myself?

 

I was just hoping maybe Prefab:Load() added a key to the returned entity like "file", "Prefabs/Characters/zombie.pfb" or something. I think this would be handy to have if we don't already.

Posted

Hi Rick,

 

you can do so if I have understood the question correctly.

 

local planet

planet = Prefab:Load("Prefabs/BlueFrozen/Planeten/Planet1.pfb")

 

planet.script.Prefabs = "Prefabs/BlueFrozen/Planeten/Planet1.pfb"

System:Print(planet.script.Prefabs)

 

greeting norbert

Posted

Yeah, that would be the manual way. I was hoping LE set a key of the entity automatically as I would be using this for saving/loading of dynamically created prefabs. It would have just been less work for the user of the save/load script to not have to do that for every prefab that they create dynamically.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...