How are we supposed to connect a spinning part to a still part?

I am currently trying to make a working propeller. This propeller will be on the back of a submarine for aesthetical purposes. I am able to successfully rotate a part when using BodyAngularVelocity. However, this propeller obviously cannot be alone and needs to be attached to a larger assembly.

I’m not sure how to do this. I have tried using hinge, rod, and weld constraints. These did not work but it could be that I applied them wrong. I would really appreciate some help, as I have been on this issue for a while and can’t seem to find an answer.

The stand (part on the right) is supposed to say in place and the propeller (part on the left) is supposed to rotate along its y axis.

Propellor succesfully spinning on its own:
robloxapp-20210514-1656234.wmv (161.6 KB)

Code inside propellor part:

local propellor = script.Parent

local y = 0

local bodyAngularVelocity = propellor:FindFirstChild("BodyAngularVelocity")

bodyAngularVelocity.AngularVelocity = Vector3.new(0,y,0)

local maxSpeed = 20

while true do

wait(.25)

y = y + 1

y = math.clamp(y,0,maxSpeed)

bodyAngularVelocity.AngularVelocity = Vector3.new(0,y,0)

end
1 Like

Sorry if this isn’t really related to scripting but what if you just moved the parts together, anchor the non spinning part and delete the welds?

Or you could just use this code:

while true do
	script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 00.1, 0) --mess around with these numbers if you want
	wait()                        
end 

Thanks for the suggestion but I want to keep using Angular Velocity so as to take advantage of its smooth rotation.

The non-spinning part is anchored. The spinning part needs to be connected to it, however, as failing to do so will cause it to fall on the ground and be unattached.

Unless you really want to use angular velocity, I would probably recommend using tweenservice to tween its rotation. It’ll be smooth and won’t be as unstable or laggy as velocity stuff. The angularvelocity could also mess with your airplane’s controls depending on how all that works.

I’m guessing from this quote that angularvelocity isn’t really necessary since tweening would be even smoother.

I’ve just spent quite a bit of time and I’ve managed to get tween service working for the propeller. I’ll have to admit this is better and I appreciate the suggestion. However, the problem still stands that I need both the spinning and the non-spinning part to move in a linear motion at once.

I ended up making a hinge constraint for the propeller and enabling the motor. I also changed the acceleration to 1 in order to get a “start up” sort of look. Thus, the propeller now moves with the help of a motor, not angular velocity or a tween. The actual submarine itself, however, automatically moves through the use of a tween. I would like to thank Mikzul and Kryxler for their help.

I’ve actually used the hinge constraint.

Use Hinge Constraint

HingeConstraint

HingeProperties

spinner.wmv (255.4 KB)

1 Like