Hello, i made an inventory gui and a button to drop items (wich are group models) for that everything is fine the only thing is that i want the item to drop in front of the player but i can only make it drop like 2 blocks away from the player but always on the same side wherever my character is facing, it will be say, -2 blocks away on the x axis of the workspace.
thats the line used to do it
drop:SetPrimaryPartCFrame(CFrame.new(player.Character.Torso.Position.x -2, player.Character.Torso.Position.y -2.7, player.Character.Torso.Position.z ))
hcf = MainPart.CFrame fp = hcf.p + hcf:vectorToWorldSpace(Vector3.new(0,0.4,-1.1)) scf = CFrame.new(fp,YeniEk.Position) ilkKutuk.CFrame = scf + (scf.lookVector * ((ilkKutuk.Size.Z/2)-1))
So, this is from my old library which I used to generate random trees. This was handling my trees' positioning and rotating needs. But to be honest I forgot what does what actually. I think scf
is position, multiplying scf's lookVector with size of ilkKutuk gives us the correct position. So, I suggest you to do something like this:
drop:SetPrimaryPartCFrame(player.Character.Torso.Position + (player.Character.Torso.CFrame.lookVector * -2))
Not sure if it will work or not.