CFrame.Angles takes in angles in radians, not degrees. Use math.rad() to convert your degrees into angles. Also, if you’re using weld instead of weld constraints, you’re going to want to specify an offset for your weld:
Here is a working version, no extra code needed:
local Debris = game:GetService("Debris")
local healCircle = Instance.new("Part")
healCircle.Shape = Enum.PartType.Cylinder
healCircle.CanCollide = false
healCircle.Massless = true
local size = 10
healCircle.Size = Vector3.new(1,size,size)
-- welds two parts together in their current relative orientation
local function createWeld(part0, part1, weldType, offset)
local weld = Instance.new(weldType or "Weld")
offset = offset or CFrame.new()
weld.Part0 = part0
weld.Part1 = part1
weld.C0 = part0.CFrame:inverse() * part1.CFrame * offset
weld.Parent = part0
return weld
end
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local newHeal = healCircle:Clone()
Debris:AddItem(newHeal,3)
newHeal.Parent = workspace
newHeal.CFrame = character.HumanoidRootPart.CFrame * CFrame.Angles(0,0,math.rad(90))
createWeld(newHeal, character.HumanoidRootPart, "Weld")
end)
end)
When the character spawns in the cylinder, it’s supposed to be flat. Like the newest gif I uploaded. However, when you spawn it, the character walks facing the same direction you were facing before you spawned it in. Once it gets removed, then the direction of the character adjusts.
I threw the code you just uploaded into studio, and it works perfectly for me. I know this isn’t ideal, but maybe it has something to do with your animation or package. Try using a motor6d weld maybe.
Massless was already true in the code you provided though? That was gonna be my first recommendation but it was already enabled in the code
With massless enabled, it doesn’t contribute to the total mass or inertia to any welded part that has mass
Edit:I was using royaltoe’s code, not yours, I just realized