This UNION OPERTION part should "glide" between 2 parts every 15 seconds however, the union is unanchored and when I play solo it falls when it should be in the air due the Body Position and start gliding towards the target part
What is wrong with this script?
local a = script.Parent a.BodyGyro.maxTorque = 40000,0,40000 wait(.01) a.Anchored = false while true do local b = Instance.new("BodyPosition", a) b.maxForce = Vector3.new(5000000,5000000,5000000) b.position = a.Parent.P2.Position wait(15) b.position = a.Parent.P1.Position wait(15) b.Parent = nil end
My guess is that on line 2 maxTorque is supposed to be a Vector3 value, but instead of had 3 numbers in a "table-like-fashion". Just put "Vector3.new(" and ")" around the numbers. I think the reason the BodyPosition isn't working is because it isn't even created because the error on line 2 is preventing the rest of the script to work.
local a = script.Parent a.BodyGyro.maxTorque = Vector3.new(40000,0,40000) --Fixed. wait(.01) a.Anchored = false while true do local b = Instance.new("BodyPosition", a) b.maxForce = Vector3.new(5000000,5000000,5000000) b.position = a.Parent.P2.Position wait(15) b.position = a.Parent.P1.Position wait(15) b.Parent = nil end
Hope it helps!