function Controller:Dash()
local movementDirection = workspace.CurrentCamera.CFrame:vectorToObjectSpace(self.CharacterObject.Humanoid.MoveDirection).Unit
local X = movementDirection.X
local Y = movementDirection.Y
local Z = movementDirection.Z
local result
if math.abs(X) > math.abs(Z) then
result = (X < 0) == true and "left" or "right"
elseif math.abs(X) < math.abs(Z) then
result = (Z < 0) == true and "forward" or "back"
else
result = "forward"
end
local root = self.CharacterObject.HumanoidRootPart
local BP = Instance.new("BodyPosition")
BP.Parent = self.CharacterObject.HumanoidRootPart
BP.D = 600
BP.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
BP.Position = root.CFrame.LookVector * 10
game:GetService("Debris"):AddItem(BP, 0.3)
end
Essentially, this:
BP.Position = root.CFrame.LookVector * 10
is sending the player to Vector3.new(0,0,0) it seems, when I print root.CFrame.LookVector * 10, I get these absurd numbers:
Setting the BP.Position to the root part’s LookVector is sending me flying away, it’s the same position over and over again so I’m presuming its the center of the map.