Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

The mesh part ignores the body velocity and behaves like it is anchored. How do fix this?

This attack is supposed to be a sword the goes where the player's mouse is. For some reason, the body velocity doesn't work with the dagger and it behaves like its anchored even though it's not. If I move it in studio then the body velocity acts how its supposed to, but other than that it doesn't.

local rep = game:GetService("ReplicatedStorage")

local assets = rep:FindFirstChild("Assets")
local events = rep:FindFirstChild("RemoteEvents")
local lightEvent = events.Light

local v3 = Vector3

local dmg = 20

lightEvent.OnServerEvent:Connect(function(player, test)
	if test[1] == "Dagger" then
		local mousehit = test[2]
		
		local char = player.Character
		local rootPart = char:FindFirstChild("HumanoidRootPart")
		
		for i = 1,2 do
			local x = assets:FindFirstChild("Light_Dagger"):Clone()
			x.Parent = workspace
			x.CFrame = rootPart.CFrame * CFrame.new(math.random(-50,50),i*4,math.random(1,20))
			
			--wait()
			x.Anchored = false
			local bv = Instance.new("BodyVelocity")
			bv.Parent = x
			bv.MaxForce = v3.new(1,1,1) * math.huge
			bv.Velocity =  (x.Position - mousehit.p).Unit * -120
			x.CFrame = CFrame.new(x.Position, mousehit.p) * CFrame.Angles(math.rad(90),0,0)
		end
		
	end
end)

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.