Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I keep this position thing from happening?

Asked by 5 years ago
Edited 5 years ago

The cloud part always wants to see to go 1 stud below the main part, and I know the script is doing this but i can't seem to figure out what part of its causing this?

Any fix?

GIF

Script that adds bodyposition

while true do
    local cloud = game.Workspace:WaitForChild("cloud")
    local storm = script.Parent
    local distance = (cloud.Position - script.Parent.Position).magnitude
    local bodyposition = Instance.new("BodyPosition")
    local check = cloud:FindFirstChild("BodyPosition")
    if distance <= 10 and not check then
        bodyposition.Parent = cloud
        bodyposition.Position = script.Parent.Position
        bodyposition.MaxForce = Vector3.new(8000,8000,8000)
        bodyposition.D = 1250
        bodyposition.P = 1000
        wait(0.01)
        bodyposition:Destroy()
    elseif distance >= 10 and not check then
        bodyposition:Destroy()
    end
    wait(0.01)
end
0
Is Collisions unchecked? Ziffixture 6913 — 5y
0
Yes, there unchecked but it still does not work. LoganboyInCO 150 — 5y

Answer this question