CFrame positioning help is needed

Hi guys! I just need to know how I could teleport a 1 x 1 stud ball 2 studs away from doge. example: doge position: 12, 9, 23. I would want the balls new position to be 12, 9, 21. I’m completely new to CFrame and understand that this is probably baby stuff. I don’t need a script I just want to be to be told how its done so I do not have to come here again. Script is located in the doge. Heres the script:

local doge = script.Parent
local dogecoin = game.ServerStorage.Dogecoin

while true do
	if doge.Parent == "ServerStorage" then
		print("Doge is not purchased yet")
	else
		local dogecoinClone = dogecoin:Clone()
		--im stuck here
	end
end

Thanks for reading and have a nice day!

if you want it to be 2 studs in front of the position then do something like this:

dogecoinClone.CFrame = doge.CFrame + doge.CFrame.LookVector * Vector3.new(2, 0, 2)

and also remember to parent the cloned coin somewhere

Thanks for your help! I’ll try it right away!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.