Need help with bodyvelocity

hey buddies, back with another problem ;;-;;
soooo

local cas = game:GetService("ContextActionService")
task.wait(2)
local functions = {}
local mouse = game.Players.LocalPlayer:GetMouse()
local maxDistance = 100
local speed = 30
local Eon = false
local Qon = false

functions.creategrapple = function(inp, state, action)
	
	if inp == "CreateGrapple" then
		if action.KeyCode == Enum.KeyCode.E then
			if state == Enum.UserInputState.Begin then
				print("'E' pressed")
				
				print(mouse.hit.p)
				if not Eon then
					print("Odm creating grapple function")
					Eon = true
					anchor = Instance.new("Part")
					anchor.Parent = workspace
					anchor.Position = mouse.hit.p
					anchor.Size = Vector3.new(1, 1, 1)
					anchor.Anchored = true
					bv = Instance.new("BodyVelocity", game.Players.LocalPlayer.Character.HumanoidRootPart)
					bv.Velocity = anchor.Position
					bv.MaxForce = 
					bv.P = 10000
				else
					Eon = false
					if anchor then
						anchor:Destroy()
						bv:Destroy()
						
					end
				end
			end
			
		end
	end
end

cas:BindAction("CreateGrapple", functions.creategrapple, true, Enum.KeyCode.E, Enum.KeyCode.Q)

in the proccess of creating an ODMG, if u know what that is, but anyways basically i need the player to move towards the ‘anchor’ part. what would i put on the maxforce in the body velocity settings to make sure the player moves towards the anchor in any world position?

1 Like