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

How to set the CFrame of a part continuously so that when it grows, it only grows in one direction?

Asked by
soutpansa 120
6 years ago

I know the title of this is a mouth full, let me explain.

I have a script that clones the Player's LeftHand, and makes the real LeftHand invisible. After that, it makes the cloned LeftHand grow. But as you can see in the gif (here) It grows above and past the player's arm. I'm not really sure how to fix this, although I had a few ideas that failed.

Here is the code that I used:

script.Parent.NormalLeft.OnServerEvent:Connect(function(Player, pos)
    local LeftHand = Player.Character.LeftHand
    LeftHand.Transparency = 1
    local Stretch = LeftHand:Clone()
    Stretch.CanCollide = false
    Stretch.Anchored = true
    Stretch.Name = "GumFist"

    for i = 1,50 do
        Stretch.Transparency = 0
        Stretch.Parent = Player.Character
        Stretch.Size = Stretch.Size + Vector3.new(0,0.5,0)
        Stretch.CFrame = LeftHand.CFrame*CFrame.new(0,-4,0)
        wait(0.00005)
    end

end)

Thanks for reading

0
I'm trying to make it look similar to this: https://gyazo.com/eb85a6f6b4fdc57c482a5eb680e3feb0 soutpansa 120 — 6y

2 answers

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

I've tried to make Gomu in the past, and the best thing I managed to do was just to make an animation that simulates luffy's hand stretching out beyond the normal range of an arm. Using resize() will only work if a part is not blocking the current path the face will enlargen through.

Also, you could go about changing the collision groups in the arm make it completely transparent and use a NewPart in the arm to have an increase, because the arms would be non-collidable you could use Resize().

Best of luck, it would be easier to script R6 Gomu (like in that ss) rather than R15 but I'd rather have your animator (or you) make an anim to simulate a Gomu Bazooka or something and run a .Touched function.

0
Something I made when I started animation kind of ugly but you get the point, https://gyazo.com/7a1b6a1adfc0b28db88cee1274abf4ee :P AttentionHog 70 — 6y
0
I've made gomu before, I just wanted to do it differently. I suppose that I'll stick with a mesh though soutpansa 120 — 6y
Ad
Log in to vote
0
Answered by
ax_gold 360 Moderation Voter
6 years ago

use Resize() instead. Here's an example with your script:

script.Parent.NormalLeft.OnServerEvent:Connect(function(Player, pos)
    local LeftHand = Player.Character.LeftHand
    LeftHand.Transparency = 1
    local Stretch = LeftHand:Clone()
    Stretch.CanCollide = false
    Stretch.Anchored = true
    Stretch.Name = "GumFist"

    for i = 1,50 do
        Stretch.Transparency = 0
        Stretch.Parent = Player.Character
        Stretch:Resize(Enum.NormalId.Bottom, 0.5)
        Stretch.CFrame = LeftHand.CFrame*CFrame.new(0,-4,0)
        wait(0.00005)
    end

end)
0
Resize() Doesn't seem to be working how I need it to. When I use it, the hand doesn't grow unless the player is walking soutpansa 120 — 6y
0
Apparently there is a part that is blocking it I guess, I'll see what I can do soutpansa 120 — 6y
0
Yeah Resize won't work. Thanks anyways, though soutpansa 120 — 6y
0
it's mainly because the hand hits the basepart. It might work if you use an animation to make the player's arm face forward ax_gold 360 — 6y
0
I did use an animation, but it didnt really produce the result that i wanted. Maybe ill try a mesh or something soutpansa 120 — 6y

Answer this question