Hello developers. So I’ve recently been testing around Roblox physics and came across BodyPositions. I was using them and realized that their speed scales by how far the target position is. I have a video as reference to show
As you see in the video, when the distance is longer, the speed is higher and so on.
Here is the code
while task.wait() do
script.Parent.BodyPosition.Position = script.Parent.Parent.outer.Position
end
So what I’m thinking is, how can I stablize the speed? I’ve messed around the dampening and power but it doesn’t seem to be working.
Im not sure how having bodyposition scaled by distance is a problem. In fact, it can be a good thing. Imagine you get teleported to another map. You would have to wait for your pet to come back, which can take a while if the map is large or far away (which is normally the case).
local Speed = script.Parent.BodyPosition.D -- just to get ur wanted speed or u can edit this to a integer of speed u want
while task.wait() do
script.Parent.BodyPosition.D = Speed*(script.Parent.Position - script.Parent.Parent.outer.Position).Magnitude
script.Parent.BodyPosition.Position = script.Parent.Parent.outer.Position
end
You could always just cframe it, the only problem is you would loose collision.
I wonder if the new constraints might be able to help with this, I am rather unfamiliar with them, but its worth a look probably.