I'm trying to make this snake animation thing with Mortor6D ,but I got a error in the output,what does it mean and how could I fix it?
If you can give me tips on how to make this script organized it will be appreciated and if you manged it fix please show how.
The error in the output is:
Workspace.Model.Script:12: bad argument #3 to 'Part1' (Object expected, got string)
Script 'Workspace.Model.Script', Line 12
Stack End
The script:
--~-----------Vairbles---------------~--
local Model = script.Parent
---------------------------------------------
for Number,Part in pairs (Model:GetChildren()) do
--------------More Vairbles----------------
local PreviousPart = math.floor(Number - 1)
local PreviousPartName = "Part"..PreviousPart
local Motor = Instance.new("Motor6D",Part)
-------------------------------------------
print(PreviousPartName)
Motor.Part0 = Part
Motor.Part1 = PreviousPartName
print(Motor.Part0)
Motor.DesiredAngle = -Number
end
I have the model setup like this:
