BodyPosition moving to wrong location?

I’m trying to make a dunk key bind using BodyPosition, however, my player always goes to the left side of the rim as shown:

I’ve tried switching the goal variable to a part at the centre of the hoop but this has yielded no results.

function rotateToHoop()
	local hoop = GetGoal()
	local goal =
	local bg ="BodyGyro", Root)
			bg.MaxTorque =, math.huge, math.huge)
			bg.P = 25000
				bg.CFrame =,, plr.Character.HumanoidRootPart.Position.Y, goal.Position.Z)) 
				wait (.5)

local function gotoHoop()	
	local hoop = GetGoal()
	local goal =
	local bodyPos ="BodyPosition", Root)
    	bodyPos.D = 1100
	    bodyPos.P = 9000
			bodyPos.MaxForce =, math.huge, math.huge)
		    bodyPos.Position = goal.Position - Root.CFrame.LookVector * 1.8

This is how I structure my code, is there any way of solving this issue?

Thanks in advance!

1 Like

Personally, I would use an animation for these types of things because body movers on characters can always cause problems.

However in your case, I assume you execute the functions directly after eachother, in which case the character will not have rotated before you index Root.CFrame.LookVector. An easier solution to create an offset is just to calculate it based on the position of both the hoop and the player.

bodyPos.Position = (,, goal.Position.Y, Root.Position.Z)) *, 0, -3)).p

3 being the goal distance between character and hoop.

1 Like

Ah, the reason I don’t use animations is that I tried previously but I couldn’t quite get them to work, but this worked!
How can I get the player to move slightly closer to the goal though even though all else is perfect!

1 Like, 0, -3)

Change the 3 to a smaller number to reduce the distance, so e.g., 0, -1.5)