Below is a clip of a key activated script in which a model is cloned and positioned to the characters CFrame. I would like to make it to where the model is floating above the character a little behind its head.
I have tried working with attachments and welding along with CFrame and Position and havent been able to figure it out on my own. Help would be appreciated.
The goal is to keep the model floating above the characters head and will follow when the player turns.
local partToClone = pathToPart:Clone() -- wherever that part is
local player = whoeverYouWantItAbove -- the player to which it'll weld
local character = player.Character
local humRootPart = character.HumanoidRootPart
local weldCons = Instance.new("WeldConstraint")
weldCons.Parent = partToClone
weldCons.Part0 = partToClone
partToClome.CFrame = humRootPart.CFrame * CFrame.new(0, 5, 0) -- this will make it 5 studs above the players root part
partToClone.Parent = workspace
partToClone.Part1 = humRootPart
The rotation is test numbers to see how it rotates but even with (0,0,0) its in the same position as before I updated the primary part with the new orientation.
perhaps weld all the parts in the model, and change the CFrame of the primary part to the CFrame of your character, and multiply the cframe so the model floats above your head.
basically CFrame is orientation plus position, not sure why orientation isn’t working for you but I usually just stick to CFrame whenever I’m doing position or rotation relating to anything connected to another part. Now that I think about it I think the 90 is in radians a not degrees so that could be it. You would have to do something like :
partToClone.Orientation += Vector3.new(90, 90, 0)
not sure if this would work as I don’t use it much and I’m writing this from my phone, please lmk.