How do i make massless not fling when touching water?

In my game, the motor2 sets massless to true for every part that is on the turret side of the car to prevent wobblying while moving.

I have noticed that this is causing a lot of issues, but i am unsure about how i could fix these issues.

Whenever the turret side of the motor2 touches the water, it flings everything into space.




What is causing this to happen and how do i solve it?

2 Likes

Make a function() or possibly a :Connect somewhere in the boat, where it gets controlled by the player. The :Connect makes the part connect to the finding when the player performs an action.

1 Like

I have already made that, i think you misunderstood my question.

The creation gets flung because the arm / turret side has massless enabled.

How would i make the motor / hingeconstraint not wobble because of heavy weight and not fling the entire creation.

1 Like

Try using a Game:GetService for the part you want to have. Use a pathfinding service so the game can tell what the player is doing and what the player is doing. I don’t suggest free models, because a lot of npc that follows you free models contain vaccine and other viruses.

1 Like

You’ll need some mass, or you’ll need to weld it in position and Enable / Disable the weld constraint whenever you are happy for it to move.

When it touches the water, it is buoyant due to being massless, and the force exerted on it by the water has no opposing force, there isn’t even inertia due to the lack of mass. That’s what I suspect is happening here.

Can you show why you made the entire arm massless in the first place? You mentioned about wobble but if it’s not meant to move at all then why can’t you just weld it during that time?

1 Like

This is the reason why i had made it massless.

1 Like

Does that vehicle also go in the water?

Have you tried using Constraints rather than motors to connect the parts? Constraints can be a lot more rigid and prevent this overextension. If you use a HingeConstraint in servo mode you can define the angle easily and set limits too.

2 Likes

The car vehicle can go into the water with no trouble, thats because there are no massless parts on there.

It is already using hingeconstraints and it is already set to servo too.

1 Like

Right okay, you referred to it as motor2 earlier which I assume now is some sort of module.

I’d advise you either reduce mass (rather than eliminate it altogether) or perhaps make everything massless except one part on the moving side.

Also have a look at Restitution and take it closer to 0 if it isn’t already.

Its still the motor2.

Restitution is already set to 0.

The parts circled in yellow have massless disabled already.


I have even tried adding an extra 2 parts which are welded to the motor2, it made the problem less likely to happen, but it still happens a lot.

I have even tried disabling massless for half of the arm, it still happened at high speeds.

Well it seems like in the example of the truck, you’d want it to be as light as possible. In the example of the arm, you’d want it to be heavy to prevent it bouncing up. You can’t just apply the same mass decisions to all types of mechanisms, so you need to look on a case by case basis.

If massless works really well for the truck one, that’s fine. But that isn’t a good reason for making this other mechanism massless too.

If it improves when you make it 50% heavy, then that’s an indication that more weight is better for that particular mechanism, which makes sense due to gravity needing to balance with the buoyancy.

I have heard that massless doesn’t really work that well for the truck aswell sometimes, people are complaining about the arm clipping inside of walls / etc.

We’ll the other option, if you don’t need it to react to anything, is use a Weld and control the rotation through CFrames, or possibly a Motor6D which is what’s used in characters and rigs.

If you want to stick with the current setup, it will likely just be a case of getting the density right (rather than all or nothing with Massless), which will probably involve a bit of trial and error, and making sure that you’re leveraging network ownership to it’s best ability by controlling the servo positions from the network owner (probably the driver in these cases).

I am surprised by the turret on the truck though, as I thought Roblox had done a lot of work with HingeConstraints to make sure it wouldn’t happen.

Also I have no idea what motor2 is. If it’s a module my advice is to try doing it manually. That way you know exactly what’s in there and can make sure you don’t have any conflicting constraints causing weird behaviour.

Motor2 is the name of the yellow circled part, sorry my bad.

Does it have to float on the water? If not, add the parts to a collision group that cannot collide with Default (you will need to make a special group for players that can collide with this new group, however) or just disable collisions for that thing entirely, if possible. This will cause it to ignore terrain, and thus solves your problem.

If it does have to float, do the same thing, but weld a single buoyant part to the end of that long rod that is responsible for making it float.

1 Like

This is a really good method.

Sadly, all of the collision groups are used in my game and the parts need to float.

1 Like

Perhaps you should investigate simplifying your collision groups, then? I understand it may not be an option, but I see no other immediate methods of fixing this problem with the exception of manually CFraming it instead of using Roblox’s physics (which will offer orders of magnitude more precision, but you have to deal with more things yourself. Do note that I mean CFraming with welds / motor6ds / whatever the best instance for this sort of motion, I can’t recall off the top of my head, not anchoring the parts.)

There comes another issue when lowering the density rather than using massless.

There are rocket engines and propellers in my game, they can create massive amount of forces and will cause the motor’s to shake again.

Also, even when setting the density to the lowest possible (0.01), the arm can still shake whenever there are a lot of parts.

What could i do against this?

If it were me I’d use a Motor6D or a Weld because I’m familiar with those and they generally get the job done when I don’t fancy letting Roblox physics have full reign.

It’s often just not worth trying to resolve all the possible forces and accounting for Roblox physics.

You know the servo position that you’re after, so you can just pop that into a Motor6D or turn it into a relative CFrame fairly easily. I think that’s the best bet if you want to cover all sorts of different attachments and mechanisms without the headache of fine tuning each one.

1 Like

What would happen whenever i use a motor6D instead of a hingeconstraint?

Would the arm easily clip inside of walls or?..