-
What do you want to achieve? Keep it simple and clear!
Add Instances created into a Trove to clean up later. -
What is the issue? Include screenshots / videos if possible!
I do not understand Troves enough, but am making progress. Whenever I try
myTrove:Add(myVectorForce)
, I get this error sayinginvalid argument to #1, to 'insert'
, as if it expects a table. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I went through the docs again and again wondering what I missed. Tried alternatives like myTrove:Clone(), myTrove:Construct(), but even those resulted in the same error. There’s no posts focused on Troves, so I’m having a hard time learning it.
--// somewhere in the start
local myTrove = Trove.new()
--// main code chunk
local moveForce = Instance.new("VectorForce")
moveForce.Name = "thrust"
moveForce.Attachment0 = hrp:WaitForChild("rootAtt")
moveForce.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
moveForce.Parent = hrp
myTrove:Add(moveForce) --// Errors here
--// somewhere in the end
myTrove:Clean()