ghoflvhxj Posted June 20, 2015 Share Posted June 20, 2015 Hi guys. I was making a trigger which, lead to death of an object, if collision with it occur. For example, there is a variable named 'health' in the MonsterAI.lua. i wrote SimpleTrigger.lua like this. Script.Enemy1pfb = "" --path "Enemy1" " Pfb file (.*pfb):pfb|Prefabs ----------------------------------------------------------------------------------------- self.enemy = Prefab::Load(self.Enemy1pfb) self.enemy.health = 0 Loading was perfect but i could not access to health. What should ㅑ do? Quote Link to comment Share on other sites More sharing options...
Thirsty Panther Posted June 20, 2015 Share Posted June 20, 2015 A large thread on this. http://www.leadwerks.com/werkspace/topic/8462-how-to-pass-variables-between-scripts-lua/ I suggested this information to be put in the variables tutorial. Hopefully that happens soon. Quote Link to comment Share on other sites More sharing options...
ghoflvhxj Posted June 20, 2015 Author Share Posted June 20, 2015 Thank you. self.enemy.script:SetMode("dying") 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.