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.
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
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
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.