For a new project I am working on, I have been trying to tween the Lower Torso along the Z axis, but only in one direction. Here is the script I have tried:
local db = true
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if db == true then
script.Parent.Transparency = 1
db = false
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
player.leaderstats.Gyatt.Value = player.leaderstats.Gyatt.Value + 5
local Character = player.Character
local LowerTorso = Character:FindFirstChild("LowerTorso")
LowerTorso.CFrame *= CFrame.new(0,0,0.05)
local X = LowerTorso.Size.X
local Y = LowerTorso.Size.Y
local Z = LowerTorso.Size.Z
print(Z)
Z += 0.1
LowerTorso.Size = Vector3.new(X, Y, Z)
script.Sound:Play()
wait(1)
db = true
script.Parent:Destroy()
end
end
end)
I am thinking it may be because the LowerTorso is welded to the humanoidrootpart, but I cannot figure out how I would go about moving it if that is so. Here is a really stupid image of the result:
What happens is it moves my whole character back by that small amount, so that is why I was thinking it has something to do with the welds.
Thank you to anyone who helps!