Help, indexing existing AEmitters
I have a problem I have made this simple search and indexing code, but it won't find any of my existing "Teleporter Texture B"s. The "Teleporter Texture B"s are placed in the scene it self. I have tried to run the script in the first updated frame instead of StartActivity(), but the same results.
Code:
--teleporter
self.Teleporter = {};
local teleporternumber = 1
for actor in MovableMan.Particles do
if string.find(actor.PresetName, "Teleporter Texture B") == true then
self.Teleporter[teleporternumber] = actor
teleporternumber = teleporternumber + 1
end
end
It works when i am defining the teleporters in the script itself instead of inside the scene, so it shouldn't be anything else than this part.