Hi,
I’m very new to Defold and Lua so pardon if this question is stupid but I’m trying to pass a table to be set on the newly created object from a factory:
if message_id == hash("respawn") then
factory.create("#factory", go.get_position(), vmath.quat(), {history: message.history})
end
I then want to use this history in the new object:
go.property("history", {})
...
-- do stuff with self.history
However, this doesn’t work since I’m getting “Only these types are available: number, hash, msg.url, vmath.vector3, vmath.vector4, vmath.quat”.
What is the correct way to solve this? The history table will be of unknown length (basically recording stuff from the game that the new object needs to take into account).