Does anyone know what could cause this? I’m just using block parts and the roblox physics engine, the rock always sticks to the ground at first, then starts behaving like I want, and then sometimes get sticky again…
I’ve messed around with CustomPhysicalProperties on both parts which seems to have no effect on this, I also have AlignOrientation and PlaneConstraint on both parts to prevent tilting and Z-axis movement, but that didn’t seem to help either
Our trouble maker rock touches the ground, and it sometimes gets stuck. Later, it moves like you want, but then it gets sticky again. Well, I’m kinda unfamiliar with 2D physical features but I suppose I can help a bit.
Why would this happen:
Friction is too high.
The rock and ground may have too much friction, so they stick together.
Constraints can cause weird behavior.
The AlignOrientation and PlaneConstraint might make the rock act strange when it’s trying to move.
Roblox puts parts to sleep.
If the rock doesn’t move much, Roblox “sleeps” it. When it wakes up, it might act wrong for a moment. But I don’t think that it is the reason at all.
How to fix it:
1. Lower the friction
2. Use a small upward force
Sometimes, the rock “sticks” because it presses too hard on the ground. You can fix this with a small force that lifts it slightly.
I’d like to tell more things but that’s all I know.
Thanks! alot of good info I wasn’t aware of. I feel like I shouldn’t even have to do CustomPhysicalProperties with so many presets available, If the ground is default plastic, player is brick or concrete and the rock is cardboard, Shouldn’t it be easy to move?
I definitely need the PlaneConstraint, but disabling AlignOrientation didn’t help.
I also unchecked “Allow Sleep” in the studio physics settings, don’t know if that does what I think but it didn’t help either.
Adding an upward force feels like a really hacky way of fixing something else that’s wrong, either on my end or with the engine itself, but I’ll look into how I’d do that…
I can’t find anything about my exact issue, except for maybe this, which is unsolved
But no one else mentions that it’s just jittery at first, then smooth,
and most of the solutions are to use constraints and tweening to move the part.
I don’t think that’s applicable in my case.
The anti-gravity force didn’t help, but it’s a really small project so far so I think I’m gonna start over and add the rock from the beginning so I can catch what exactly makes it act that way.
Are you sure the client has network ownership of the rock?
(AKA calling Part:SetNetworkOwner(plr) on the server)
This looks similar to behavior from the client not actually simulating the physics, which makes it a bit delayed and jittery.
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
for i, part in ipairs(game.Workspace:GetDescendants()) do
if part:IsA("BasePart") then
part:SetNetworkOwner(Player)
end
end
I can’t get visualization modes to work, my laptop might be too crappy, does it look right to you?
The only issue I see with this is that you are using Players.LocalPlayer, which is just nil from the server’s perspective. This causes the code to not actually assign ownership to the client.
With the following code we just assign network ownership to the first player to connect:
local Players = game:GetService("Players")
Players.PlayerAdded:Once(function(Player)
for i, part in ipairs(game.Workspace:GetDescendants()) do
if part:IsA("BasePart") then
part:SetNetworkOwner(Player)
end
end
end)