Problem with Parachute's position

I’m trying to make a skydiving system on roblox.But I’m facing a problem.When the skydiving animation plays, the parachute appears but it’s position is little far from the character.I don’t know where the problem is.Here is the script and a video footage of the problem:
video:
robloxapp-20201220-1837424.wmv (1.6 MB)

Script:

local char = script.Parent
local hrp = char:WaitForChild("HumanoidRootPart")
local hum = char:WaitForChild("Humanoid")
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://**********animation Id"
local anim = hum:LoadAnimation(animation)
local freefalling = false


function transparentChute()
	 chute = game.ReplicatedStorage.Chute:Clone()
	chute.Parent = char
	for _, v in pairs(chute:GetChildren()) do
		v.Transparency = 1
	end
end
transparentChute()
function openChute()
	local chuteWeld = chute.Handle:WaitForChild("ChuteWeld")
	if chuteWeld then
		chuteWeld.Part1 = hrp
		local chuteCFrame = chute.PrimaryPart.CFrame
		chuteCFrame = hrp.CFrame * chuteCFrame:ToWorldSpace(hrp.CFrame)
		local chuteComponents = chute:GetChildren()
		for _, v in pairs(chuteComponents) do
			if v.Transparency == 1 then
				v.Transparency = 0
			end
		end
	end
end
function freefall()
	local currentState = hum:GetState()
	if currentState == Enum.HumanoidStateType.Freefall then
		local bodyVelocity = Instance.new("BodyVelocity", hrp)
		bodyVelocity.Name = "Freefall"
		bodyVelocity.MaxForce = Vector3.new(0, 100000, 0)
		bodyVelocity.P = 1000000
		bodyVelocity.Velocity = Vector3.new(0, -50, 0)
		bodyVelocity.Parent = hrp
		print("Successfull")
		anim:Play()
		if not freefalling then
			freefalling = true
		end
		print(freefalling)
		openChute()
	end
end

hum.StateChanged:Connect(function(oldState, newState)
	if newState == Enum.HumanoidStateType.Freefall then
		wait(4)
		if newState == Enum.HumanoidStateType.Freefall then
			freefall()
		end
	elseif newState ~= Enum.HumanoidStateType.Freefall then
		local check = hrp:FindFirstChild("Freefall")
		if  check   and freefalling then
			freefalling = false
			print(freefalling)
			anim:Stop()
			check:Destroy()
		end
	end
end)```

Can you format the script correctly please? e.g.: Put ``` at the beginning and end of the script, so we can help you better.

I formatted the script.Now you can check.

1 Like

Hmm, is that the entire script?

1 Like

Yes . It is the entire script. You can also check the video footage to find out the problem.

Have you tried offsetting the weld? You can do this with chuteWeld.C0 property.

1 Like

I tried this. But It shows an error :“C0 cannot be assigned to”

Are you setting it to a Vector3? It only accepts CFrame.

1 Like

I noticed that I’m using the Weld Constraint.Weld Constraint does not use C0, C1…
Is there any other way?

I researched a bit and I think it is an issue with latency between server and client. Sorry, I don’t have much experience with Weld Constraints either so I can’t help much further.

Also the CFrame is not set here on

Because chuteCFrame is a CFrame value, not a reference. Change it to

	local chuteCFrame = chute.PrimaryPart.CFrame
	chute.PrimaryPart.CFrame = hrp.CFrame * chuteCFrame:ToWorldSpace(hrp.CFrame)

And then you can offset it by multiplying it with a CFrame value I think.

	local chuteCFrame = chute.PrimaryPart.CFrame
	chute.PrimaryPart.CFrame = hrp.CFrame * chuteCFrame:ToWorldSpace(hrp.CFrame) * offset
1 Like

I tried but didnt get expected result.But I tried motor6D and It worked.But thanks bro.! :slight_smile:

Glad you got it to work at least. :sweat_smile:

1 Like