I’m trying to rotate a part inside my gun model (like 10 more parts are constraint welded to this main part) And I want to rotate the main part to rotate all other parts. The script works inside a single part in the workspace. But it doesn’t do anything when it’s inside the gun model. Any idea what I’m doing wrong? Can you not use tween rotation when a part is welded?
Rotation script:
task.wait(10)
print("rotating")
local partToRotate = script.Parent
local TweenService = game:GetService("TweenService")
local spininfo = TweenInfo.new(
2, -- Length
Enum.EasingStyle.Bounce, -- Easing Style
Enum.EasingDirection.Out, -- Easing Direction
8, -- Times repeated
true, -- Reverse
0 -- Delay
)
Spin1 = TweenService:Create(partToRotate,spininfo,{CFrame = script.Parent.CFrame * CFrame.Angles(90,math.rad(120),90)})
Instead of welding the parts together with a Weld, you should use a Motor6D to weld them. Then you can make an rotate animation and load it using an Animator in your gun model. Then when you want to rotate the part, you play the animation instead.
This plugin is very useful for inserting Motor6Ds into your model, and positioning their pivot point.
If I use motar6D it messes up the position and alignment. Like instead of staying where I’ve positioned it, it jumps near the handle part or whatever the part(1)/part(0)/counter part position is?
Aren’t all parts technically a descendant weld of the handle though?
Like in this case I would of welded a bunch of parts to the main part I want to rotate. And then that main part is then welded to the handle. Otherwise how else would you make a gun?