Hey! I’m making a Gomu-Gomu no mi Script (One Piece)
→ If you don’t know what that means, it’s an ability that makes your body elastic so you can stretch your arms and punch your enemies
The only problem is, that the tween goes into two directions. Front and back. How to I make it so it only tweens to the front? Here is a video about the behaviour:
Here is a snippet of the script (which is the most important part I guess)
tweenService:Create(fakeRightArm, TweenInfo.new(0.3, Enum.EasingStyle.Quad), {Size = fakeRightArm.Size + Vector3.new(0, 50, 0)}):Play()
I tried doing
tweenService:Create(fakeRightArm, TweenInfo.new(0.3, Enum.EasingStyle.Quad), {Size = fakeRightArm.Size + Vector3.new(0, 50, 0), Position = fakeRightArm.Position + Vector3.new(0, 0, 50)}):Play()
but that makes it literally fly out of my arm.
Thank you!
3 Likes
If I’m correct, try and use lookVector/upVector/rightVector, which is a property of CFrame. This ensures to resize the part in a specific direction.
2 Likes
Size = fakeRightArm.CFrame.LookVector + Vector3.new(0,50,0)
Or what do you mean?
Hey yeah, you can probably do this when tweening your Fake arm, here:
fakeRightArm.CFrame = fakeRightArm.CFrame * CFrame.new(0, 0, 50/2) -- Divide the axis by two you are resizing the part from
1 Like
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/2)}):Play()
Still doesn’t work. Same issue as in the video.
1 Like
You can do this.
game.Workspace.Part.CFrame = game.Workspace.Part.CFrame + (game.Workspace.Part.CFrame.lookVector * 5)
1 Like
You need to use a Vector3 value if your multiplying it. And also, this still doesn’t work.
1 Like
No, when using CFrames, multiplying is like adding.
Oh okay. Try and use lookVector to see if it works or not.
Disclaimer: lookVector only works on front surfaces of the part.
Like this?
tweenService:Create(fakeRightArm, TweenInfo.new(0.3, Enum.EasingStyle.Quad), {Size = fakeRightArm.Size + Vector3.new(0, 50, 0), Position = RightArm.CFrame.LookVector * 20}):Play()
That doesn’t work, for some reason it tweens it up in the air.
RightArm is the RightLowerArm of the character btw.
Sorry, but I forgot to mention that Size can also use CFrames, so it would be like:
part.Size = (part.CFrame + part.CFrame.lookVector*5)
EDIT: I’ve made a small mistake here, it’s a + not *.
Weldify
(Weldify)
October 28, 2020, 11:53am
#12
Motor6D’s have a property named C0, that is basically the CFrame offset position of the joint, tween it aswell, and tween it in the direction of the size addition and split it by half the size addition
1 Like
But it’s a FakeArm, it’s not the real RightLowerArm.
1 Like
But that doesn’t change the size…
Weldify
(Weldify)
October 28, 2020, 11:55am
#15
In the video, it changes the size of the fake arm.
Weldify
(Weldify)
October 28, 2020, 11:55am
#16
Now tell me, what do you use to connect the fake arm to the real arm?
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"
A weld.
Weldify
(Weldify)
October 28, 2020, 11:56am
#19
Weld.C0 is what you are looking for, it is a CFrame, when you modify it, it changes the offset of the connected part.
1 Like
But this is a WeldConstraint, not a normal weld It only has Part0 and Part1.
Should I replace it with a normal weld?