How to only tween in one direction when using a WeldConstraint?
Asked by
4 years ago Edited 4 years ago
Hey! I'm trying to make a gomu script, it should stretch out his arm.
Here is my script
01 | local fakeRightArm = Instance.new( "Part" ) |
02 | fakeRightArm.BottomSurface = Enum.SurfaceType.Smooth |
03 | fakeRightArm.CanCollide = false |
04 | fakeRightArm.Massless = true |
05 | fakeRightArm.Material = Enum.Material.Plastic |
06 | fakeRightArm.BrickColor = RightArm.BrickColor |
07 | fakeRightArm.Size = RightArm.Size |
08 | fakeRightArm.CFrame = RightArm.CFrame |
09 | fakeRightArm.Parent = character |
10 | fakeRightArm.Name = "fakeRightArm" |
11 | local weld = Instance.new( "WeldConstraint" ) |
13 | weld.Part 1 = fakeRightArm |
14 | weld.Parent = character |
15 | weld.Name = "FakeArmWeld" |
18 | tweenService:Create(fakeRightArm, TweenInfo.new( 0.3 , Enum.EasingStyle.Quad), { Size = fakeRightArm.Size + Vector 3. new( 0 , 50 , 0 ), CFrame = fakeRightArm.CFrame * CFrame.new( 0 , 0 ,- 50 ) } ):Play() |
The only problem is, that it ignored the CFrame and just tweens in both directions, not only to the front.
It's probably because of the weld.
DevForum post (maybe more detailed): https://devforum.roblox.com/t/how-to-only-tween-in-one-direction/841408/42
Thank you!