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

how to stop parts from spinning and rotating while theyre floating with bodyposition?

Asked by 5 years ago

I am working on custom water for my classic roblox type game and it uses body position to float objects which works 100% of the time but they continue to float and rotate and spin i've tried bodygyro but i dont know how to use it. how would I have a part touch the water, then get a body gyro equal to its original orientation? also, theyre all 2048 by 55 by 2048 parts and rely on the player to build something and have it touch the water. its a script in replicatedstorage that is duplicated into every "water part"

01local sealevel1 = script.Parent.Position
02local sealevel2 = script.Parent.Position.Y
03test = false
04 
05script.Parent.Touched:Connect(function(part)
06if part.Name == "HumanoidRootPart"
07then    local bodyposition = Instance.new("BodyPosition",part)-- second arg is parent
08        bodyposition.MaxForce = Vector3.new(0,math.huge,0) -- no other directions matter
09        bodyposition.Name = "BP"-- \/ no other directions are important
10        bodyposition.Position = Vector3.new(0,sealevel2 + (script.Parent.Size.Y / 2),0) -- /2 so its not at the center but at the top
11end
12end)
13 
14script.Parent.Touched:Connect(function(part)
15if part.Parent.Name == "Floatable_Parts" or test == true
View all 27 lines...
0
Wait, what is bodyposition? goodlead -62 — 5y
0
Did you try to set body gyro's max force to inf,inf,inf? imKirda 4491 — 5y

Answer this question