I’m making a script that moves a creatures legs (and other limbs like tails and arms in the future) and pull it forward its not working well and I don’t know how to iron it out:
robloxapp-20220711-1901283.wmv (3.1 MB)
Sure inch-worming is better than nothing but it can’t stand up or run
This is the very basic script:
print("ONNN")
script.Parent.Body.PrimaryPart.Pulling.Position = Vector3.new(CFrame.new(script.Parent.Body.PrimaryPart.CFrame.X + 20,script.Parent.Body.PrimaryPart.CFrame.Y + 20,script.Parent.Body.PrimaryPart.CFrame.Z))
script.Parent.Body.PrimaryPart.Pulling.MaxForce = 400000000000
for i,e in pairs(script.Parent.Supports.WalkingPairs.Number1:GetChildren()) do
e.Value.Leg1.LegEnd.Foot.BaseOfFoot.PlantFoot.MaxForce = 800000000000
e.Value.Leg1.LegEnd.Foot.BaseOfFoot.PlantFoot.Position = Vector3.new(e.Value.Leg1.LegSegment1.ConnectionStart.CFrame.X + e.Value.Leg1.LegEnd.Foot.Size.X*25 ,e.Value.Leg1.LegSegment1.ConnectionStart.CFrame.Y - e.Value.Info.HoldUpVal.Value,e.Value.Leg1.LegSegment1.ConnectionStart.CFrame.Z)
e.Value.Leg2.LegEnd.Foot.BaseOfFoot.PlantFoot.MaxForce = 400000000000
e.Value.Leg2.LegEnd.Foot.BaseOfFoot.PlantFoot.Position = Vector3.new(e.Value.Leg2.LegSegment1.ConnectionStart.CFrame.X,e.Value.Leg2.LegSegment1.ConnectionStart.CFrame.Y - e.Value.Info.HoldUpVal.Value,e.Value.Leg2.LegSegment1.ConnectionStart.CFrame.Z)
end
for i,e in pairs(script.Parent.Supports.WalkingPairs.Number2:GetChildren()) do
e.Value.Leg2.LegEnd.Foot.BaseOfFoot.PlantFoot.MaxForce = 800000000000
e.Value.Leg2.LegEnd.Foot.BaseOfFoot.PlantFoot.Position = Vector3.new(e.Value.Leg2.LegSegment1.ConnectionStart.CFrame.X + e.Value.Leg1.LegEnd.Foot.Size.X*25 ,e.Value.Leg2.LegSegment1.ConnectionStart.CFrame.Y - e.Value.Info.HoldUpVal.Value,e.Value.Leg2.LegSegment1.ConnectionStart.CFrame.Z)
e.Value.Leg1.LegEnd.Foot.BaseOfFoot.PlantFoot.MaxForce = 400000000000
e.Value.Leg1.LegEnd.Foot.BaseOfFoot.PlantFoot.Position = Vector3.new(e.Value.Leg1.LegSegment1.ConnectionStart.CFrame.X,e.Value.Leg1.LegSegment1.ConnectionStart.CFrame.Y - e.Value.Info.HoldUpVal.Value,e.Value.Leg1.LegSegment1.ConnectionStart.CFrame.Z)
end
script.Parent.Body.PrimaryPart.Pulling.MaxForce = 0
wait(2)
script.Parent.Body.PrimaryPart.Pulling.Position = Vector3.new(CFrame.new(script.Parent.Body.PrimaryPart.CFrame.X + 20,script.Parent.Body.PrimaryPart.CFrame.Y + 20,script.Parent.Body.PrimaryPart.CFrame.Z))
script.Parent.Body.PrimaryPart.Pulling.MaxForce = 400000000000
for i,e in pairs(script.Parent.Supports.WalkingPairs.Number1:GetChildren()) do
e.Value.Leg2.LegEnd.Foot.BaseOfFoot.PlantFoot.MaxForce = 800000000000
e.Value.Leg2.LegEnd.Foot.BaseOfFoot.PlantFoot.Position = Vector3.new(e.Value.Leg2.LegSegment1.ConnectionStart.CFrame.X + e.Value.Leg2.LegEnd.Foot.Size.X*25 ,e.Value.Leg2.LegSegment1.ConnectionStart.CFrame.Y - e.Value.Info.HoldUpVal.Value,e.Value.Leg2.LegSegment1.ConnectionStart.CFrame.Z)
e.Value.Leg1.LegEnd.Foot.BaseOfFoot.PlantFoot.MaxForce = 400000000000
e.Value.Leg1.LegEnd.Foot.BaseOfFoot.PlantFoot.Position = Vector3.new(e.Value.Leg1.LegSegment1.ConnectionStart.CFrame.X,e.Value.Leg1.LegSegment1.ConnectionStart.CFrame.Y - e.Value.Info.HoldUpVal.Value,e.Value.Leg1.LegSegment1.ConnectionStart.CFrame.Z)
end
for i,e in pairs(script.Parent.Supports.WalkingPairs.Number2:GetChildren()) do
e.Value.Leg1.LegEnd.Foot.BaseOfFoot.PlantFoot.MaxForce = 800000000000
e.Value.Leg1.LegEnd.Foot.BaseOfFoot.PlantFoot.Position = Vector3.new(e.Value.Leg1.LegSegment1.ConnectionStart.CFrame.X + e.Value.Leg1.LegEnd.Foot.Size.X*25 ,e.Value.Leg2.LegSegment1.ConnectionStart.CFrame.Y - e.Value.Info.HoldUpVal.Value,e.Value.Leg2.LegSegment1.ConnectionStart.CFrame.Z)
e.Value.Leg2.LegEnd.Foot.BaseOfFoot.PlantFoot.MaxForce = 400000000000
e.Value.Leg2.LegEnd.Foot.BaseOfFoot.PlantFoot.Position = Vector3.new(e.Value.Leg2.LegSegment1.ConnectionStart.CFrame.X,e.Value.Leg2.LegSegment1.ConnectionStart.CFrame.Y - e.Value.Info.HoldUpVal.Value,e.Value.Leg2.LegSegment1.ConnectionStart.CFrame.Z)
end
script.Parent.Body.PrimaryPart.Pulling.MaxForce = 0
wait(2)
Is the script not going about this the right way? are there any resources that can help?