holschuh Posted July 4, 2015 Share Posted July 4, 2015 HI, i have an prefab entity with an script attached. so i want to load by lua code and set 2 "target" entity vars. but the Script:start() is in the moment i load the prefab running and wants to access my 2 "target" vars which are nil then. must i handle this by myself with some code or is there a way to prevent an Script in Prefab from running after loading it by code? the script loading the cow.pfb self.enemy=Prefab:[b]Load("Prefabs/cow.pfb")[/b] self.enemy.script.spawnpoint1=self.entity self.enemy.script.spawnpoint2=self.spawn2 the scrip in the cow.pfb Script.spawnpoint1 = nil--Entity "SP1" Script.spawnpoint2 = nil--Entity "SP2" function Script:Start() [b] self.xplus=self.spawnpoint2:GetPosition().x[/b] self.first=true .... cu Volker Quote Link to comment Share on other sites More sharing options...
holschuh Posted July 4, 2015 Author Share Posted July 4, 2015 Ahh found something Prefab.NoStartCall http://www.leadwerks.com/werkspace/topic/12523-load-prefab-pass-entity/page__hl__prefab cu Volker Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.