How do I best avoid glitchy collisions with un-anchored objects?

Video of issue

The intention is to simply have a raft that players can walk around on and swim up to. The walking part is fine, but as soon as a character swims up to it, the raft starts bouncing around and going out of control.

I’ve been racking my brain trying to get around this seemingly inescapable bug in the Roblox physics engine. Part densities don’t seem to come into play, as the object being thrown around by the player is many times more massive than the character.

Should I ditch this game idea? How do other games with floating objects like Sharkbite/Tradelands work? I really need someone to help me out!!

Could you try anchoring your ship by attaching it via a weld to an invisible, uncollidable, dense part with a similar size to the raft? This might be a work around to your issue. Otherwise, you’ll have to use some sort of maths to keep its position relative, or even use your own raft system over the roblox physics.

This is an interesting idea. I’ll try this out and get back to you.

Sadly getting the same results. Believe this may just be an unavoidable problem with server-client collision communication.

I’m watching the video over again, is your water real roblox water with a part over the top of it or is it a custom script?

Custom script. The only acting force is a BodyPosition with max force (0, math.huge, 0) on both the character and the raft.

Sharkbite uses the roblox terrain water and its physics to keep the boats upright while players stand on them.

That being said… your raft is more like dock? do you want it to remain stable or float around?

Also, why arent you using roblox water terrain?

The raft is intended to float around and be driven by the player. Default roblox water is certainly an option, i just prefer a custom solution because of how much more control I would get.

1 Like

Perhaps instead of using a BodyForce as the force on the water, maybe use CFrame manipulation in conjunction with PIDs to give your boat and player a more believable water. This will also give you more control over the rafts and won’t have them interfered with by the player.

What? How is any of that false information.

Did you want players to be able to push the rafts around? If not, one fix might be a one-way collision group in which players can touch the raft, but the raft can’t touch players.

I don’t often deal with raw physics, so I would personally write my own system for specific physics interactions that I don’t trust Roblox’s physics to handle. A raft/boat system might be one of those.

.
I would kindly ask you to refrain from trolling as it is not permitted in these developer forums.

give it invisible mass or something possibly, but then i remember roblox has some really bad physics

your best bet would be making it artificial, but im sure that could get annoying rather quickly, body positions angular stuff i dont really know

How exactly might this work? Sounds like an interesting idea and I wouldn’t mind the player being unable to push a raft around.

Using Collision Filtering, you can make groups of objects collide or not collide with other groups. NoCollisionConstraint is another option, but it’s on a per-part basis. Now to make it one-way, as far as I’m aware, that isn’t possible directly. However, you can use FilteringEnabled to make it work the way I’m meaning. Basically, you make players and rafts not collide with each other server-side, but make them collidable on the client right after. The end result should be what I said.

Some visual examples from those pages:


NoCollisionConstraintDemo-min

I am acquainted with collision groups. I’m not exactly sure what you mean by a one way collision group though. How do I make it so a player can collide with a raft, but the raft is never affected by a player?

By setting the network owner of the raft to the server. However, that may not work for you.

Like what @RatiusRat said, you could set the network owner of the raft to the server.
Here is an article about it: Network Ownership

This has helped me stop the choppiness of my pathfinding script, so I hope this helps you too.