The script is supposed to clone a model to the Workspace and position and rotate itself to be the position of the player and face the direction the player is looking.
However it spawns too high on the Y-Axis and I need to set it to 2.2 on the Y-Axis in the world (not add or decrease to its current CFrame)
I am just confused how to do this and have tried loads of different things, help would be greatly appreciated.
local freekickwall = game.ServerStorage.FreeKickWall:Clone()
freekickwall.Parent = game.Workspace
freekickwall:SetPrimaryPartCFrame(Character.HumanoidRootPart.CFrame + Character.UpperTorso.CFrame.lookVector)
(EDITED) Answered with the help of radusavin366 and my friend InedibleGames
local freekickwall = game.ServerStorage.FreeKickWall:Clone()
freekickwall.Parent = game.Workspace
local humframe = Character.HumanoidRootPart.CFrame
local inedcalc = humframe.p.Y - 2.2
humframe = humframe - Vector3.new(0, inedcalc, 0)
freekickwall:SetPrimaryPartCFrame(humframe + Vector3.new(Character.HumanoidRootPart.CFrame.lookVector.X, 0, Character.HumanoidRootPart.CFrame.lookVector.Z))

7 comments
So CFrame.humframe.Y? Not CFrame.Y? That could come in handy
Wait... not CFrame.humframe but CFrame humframe without the dot?
No, "local humframe = Character.HumanoidRootPart.CFrame" and "humframe.Y = 2.2" are separate statements so not dots, editing to make it clear.
Thanks for the answer! It comes with an error "Y cannot be assigned to" on line 4
edited again
I edited my answer, it was a lot more complicated, thanks for the help though you helped come to the solution !
no problem :)