Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

local fakeRightArm = Instance.new("Part")
    fakeRightArm.BottomSurface = Enum.SurfaceType.Smooth
    fakeRightArm.CanCollide = false
    fakeRightArm.Massless = true
    fakeRightArm.Material = Enum.Material.Plastic
    fakeRightArm.BrickColor = RightArm.BrickColor
    fakeRightArm.Size = RightArm.Size
    fakeRightArm.CFrame = RightArm.CFrame
    fakeRightArm.Parent = character 
    fakeRightArm.Name = "fakeRightArm"
    local weld = Instance.new("WeldConstraint")
    weld.Part0 = RightArm
    weld.Part1 = fakeRightArm
    weld.Parent = character
    weld.Name = "FakeArmWeld"


    tweenService:Create(fakeRightArm, TweenInfo.new(0.3, Enum.EasingStyle.Quad), {Size = fakeRightArm.Size + Vector3.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!

Answer this question