ghoflvhxj Posted June 20, 2015 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
Thirsty Panther Posted June 20, 2015 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
ghoflvhxj Posted June 20, 2015 Author Posted June 20, 2015 Thank you. self.enemy.script:SetMode("dying") Quote
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.