So the problem is that it only teleports one of the Slashes and not all of them. Please help!
for i,v in pairs(plr.Character.MistSlash:GetChildren()) do
if v:IsA("MeshPart") then
v.CFrame = plr.Character.HumanoidRootPart.CFrame + Vector3.new(0,0,-0.5)
end
end
There isn’t anything wrong with the code, try printing out how many MeshParts are available inside the MistSlashes by adding a print statement right after the if statement.
You’re right! I thought that was not it because I had custom orientation for each one of them but the orientation resets when they get teleported for some reason. Anyway thank you!
That’s because a CFrame value contains both positional & orientational data. If you want to retain the rotations of the teleported BasePart instances then change their “Position” properties only.
for i,v in pairs(plr.Character.MistSlash:GetChildren()) do
if v:IsA("MeshPart") then
v.Position = plr.Character.HumanoidRootPart.Position + Vector3.new(0, 0, -0.5)
end
end