BodyVelocity = 0,0,0 after setting it

local debrisTime = 100
	local multiplier = 500
	target.CFrame = HRP.CFrame + HRP.CFrame.LookVector.Unit
	local bv = Instance.new("BodyVelocity",target)
	bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
	print(HRP.CFrame.LookVector.Unit * multiplier)
	print(bv)
	bv.Velocity = Vector3.new(HRP.CFrame.LookVector.Unit * multiplier)
	delay(0,function()
		while wait(0.03) do
			bv.Velocity = Vector3.new(HRP.CFrame.LookVector.Unit * multiplier)
			print("done")
		end
	end)
	print(bv.Velocity)
	print("done")

Outputs:

  01:24:17.347  -86.85325622558594, -0, -492.39874267578125  -  Server
  01:24:17.347  BodyVelocity  -  Server
  01:24:17.350  0, 0, 0  -  Server 
  01:24:17.350  done  -  Server 

Does anyone know why the BodyVelocity.Velocity changes back to 0?

Does the

	delay(0,function()
		while wait(0.03) do
			bv.Velocity = Vector3.new(HRP.CFrame.LookVector.Unit * multiplier)
			print("done")
		end
	end)

not run?

1 Like

Maybe the Vector3.new(HRP.CFrame.LookVector.Unit * multiplier) could return 0, 0, 0

1 Like

According to the wiki there’s no Vector3 constructor that takes a Vector3. Try

bv.Velocity = HRP.CFrame.LookVector * multiplier

(don’t need .Unit, LookVector is almost always a unit vector anyway)

worked when i just removed the Vector.new wrapper. Thanks!

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