[UNSOLVED] Turning Turrets with CFrames, Welds, or Motor6D's Causes Ship to Flip Over?

What are the Density Properties of the Parts involved. If you have differences between them it may cause issues with one taking control over the other.
I have an excavator that uses motor6Ds to control the boom and when I left the seat the angle would inverse. When I got back in the seat it would flip back. A friend told me about the Density issues and after changing them it worked.

1 Like

I have never messed around with Density. I’ve also tried making the turrets massless but that didn’t do anything different.

I have the base and arms on my excavator all set with Density = .1
Having even one of them with a different Density (especially Massless) made a big difference to how they reacted.

In a good way or bad way? I haven’t messed with Density ever before, and this is also my first time dealing with Motor6D’s.

Basically what I said,
Match Densities of the Parts involved for good results.
Make the Densities different and you may get poor results.

Since I didn’t touch part Density at all, I think they’re all already the same density by default.

When I first read the title I originally thought about how welds sometimes don’t update according to a Body mover. As in the body mover like a BodyGyro might think the weld has not changed after you change it. After watching the videos, I think maybe the upvector might be finnicky whenever you create a cframe (consider CFrame.lookAt() instead of CFrame.new()). If you haven’t already, maybe try something like:

local currentCf, toPoint;
newCf = CFrame.lookAt(currentCf.Position, toPoint, currentCf.UpVector)

Are you recommending this instead of the TargetCFrame with targetAngle (direction) that I currently have set up?

If that is a solution then I may be able to somehow make it work, but the problem is that I also need to have constraints on the rotation here (like a hinge) which is measured in degrees. Also, it needs to slowly rotate toward the point rather than instantly aiming there.

The other big clue that’s confusing me here is that it works fine with only one turret, but then when there’s more than one it causes the ship to flip, but only when the guns aim to either side. It gets a little more confusing when you include the fact that one of the ship types flips over even when it only has one gun on it.

Slight update: I changed the root priority of the turret’s rotorPart (the part on the bottom of the turret that connects to the static part on the turret ring) to 1, with the rest of the ship set to 0, and this was the result:

Speaking of this let’s do some further debugging with these visualization methods since the ship should also count as a Motor6D rig, what does the rig look like? Can you visualize it within something like RigEdit lite.

Also are you able to animate in when you add a animation controller?

If so then are the rotations occuring as intended when you try to manually edit it?

Usually you need to follow a similar structure like rootpart → Body → arms like a normal rig which is how I test mine are working as intended with the correct root part.

You cannot really skip the steps such as Body → arms as it causes weird bug issues like the one below :point_down:.

For example this problem:

I don’t exactly know what that would look like (I’ve barely ever messed with Motor6D’s), but it’d probably be very barebones considering I didn’t use any plugins for Motor6D and really all I did was insert a Motor6D through script similarly to inserting a weld. “Bote” is the main part of the model “Boat,” and TurretRing is a child (alongside Bote) of “Boat,” with RingRotor (a basepart) being a child of TurretRing and RotorWeld (the Motor6D) being a child of RingRotor. I have basically been treating the Motor6D like a normal weld except for when I use .Transform, which has the same exact result nonetheless.

To debug further try printing out the root part BasePart:GetRootPart.

I would also suggest moving it to an empty baseplate and see if you could replicate the samething. Also where is the body gyro located?

Personally I’m guessing the C0 is effecting the body gyro part which is causing the rotation, some sort of chain effect.

Also I made an alternative method using CFrame.lookAt with constraints. And the rig thing I mentioned is this, if you select the model with RigEdit lite, it helps debug where the joint positions are which greatly influence the movement and rotation center of the turrets.

Currently, there doesn’t seems to be enough information and hence requires more debugging. Is the body gyro the problem? Any code related to CFrames?

Which part should I call :GetRootPart on?

The body gyro is located in the part “bote” (an invisible part roughly in the middle of the ship and elevated a bit above it), which is a child and primary part of the model “Boat” (the whole ship). The gun (a model) is also a child of Boat. “TurretRing” (a flat cylinder part fixed to the hull of the ship, doesn’t turn) is also a child of Boat, and RingRotor (a small base part fixed to TurretRing, doesn’t turn) is a child of TurretRing, with RotorWeld (the Motor6D) being a child of RingRotor and connected to Rotor (a child of gun, does turn).

Here’s a crude label of the hierarchy (it’s probably not too helpful):

Any part works since it’s one assembly they all should have the same root part.

I would also make this part visible since it’s very important to the orientation, also put a decal to see where this part is facing.

I went ahead and tested these.

Bote is the root part, and also bote is oriented forward, and stays oriented forward when it flips. I somewhat knew this already because otherwise the ship wouldn’t remain moving forward when it’s flipped.

Considering that so far the Motor6D attempt I have here has pretty much been playing out exactly the same as the normal weld attempt, is there a way I can make this work with normal welds and c0-setting, or is there something specific now I need to do to get around this issue?

Have you tried turning the Motor6D using CurrentAngle, DesiredAngle and MaxVelocity instead of CFraming it?
I didn’t notice if you had in the above posts.

All you’d need to do in your aiming script is to set the DesiredAngle to the point you wanted it aimed to.

I somewhat did. I couldn’t quite figure out how I needed to re-orient the parts so that it would rotate on the correct axis, so I guess my tests for that might not be the most accurate, but (if I remember correctly,) I did see the same results with the ship getting flipped. It might be a solution still, but I’d have to fiddle with it more.

Motor6D’s only rotate one direction when enabled this way.
I usually take 2 Parts that are slightly different sizes (like 1,.8,1 and .8,1,1) so they can be selecte easily, make them Transparency .5 and then weld one to the chassis (in your case the boat) and the other to my steering mechanism. Then if they aren’t rotating in the right axis I just select both Parts at the same time (if you do one at a time it’ll break the Motor6D) and then use the Rotate tool to put them in the direction that’ll get the correct axis.