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?
dynamic torch removal
- Zo Kath Ra
- Posts: 931
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: dynamic torch removal
Destroying the torch seems to work.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?
Code: Select all
if torch_holder_1.socket:count() == 1 then
torch_holder_1.socket:getItem().go:destroy()
end
Re: dynamic torch removal
Once again, Thank you.