Page 1 of 1

dynamic torch removal

Posted: Thu Apr 23, 2020 4:07 pm
by RayB
I am trying to remove a torch from a torch holder using script..

I have tried setting the 'hasTtorch' controller component to false but it doesn't work.
Even if I destroy the torch holder and then spawn a new one and set the' hasTorch' controller component to false (as done in the dungeon.lua file) it still doesn't work.

Can anyone tell me how to do this?

Re: dynamic torch removal

Posted: Thu Apr 23, 2020 4:31 pm
by Zo Kath Ra
RayB wrote:
Thu Apr 23, 2020 4:07 pm
I am trying to remove a torch from a torch holder using script..

I have tried setting the 'hasTtorch' controller component to false but it doesn't work.
Even if I destroy the torch holder and then spawn a new one and set the' hasTorch' controller component to false (as done in the dungeon.lua file) it still doesn't work.

Can anyone tell me how to do this?
Destroying the torch seems to work.

Code: Select all

if torch_holder_1.socket:count() == 1 then
	torch_holder_1.socket:getItem().go:destroy()
end

Re: dynamic torch removal

Posted: Thu Apr 23, 2020 11:44 pm
by RayB
Once again, Thank you.