how to make all my knife move? i tried change the velocity and its not working i changed it knife.CFrame

local Starttime = tick()
repeat
wait(0.05)
local knife = script.Knife:Clone()
knife.Parent = workspace
knife.CFrame = enemy:WaitForChild("UpperTorso").CFrame * CFrame.new(math.random(-5,5),math.random(-3,3),math.random(-5,5))
knife.Orientation = enemy:WaitForChild("UpperTorso").Orientation
local ignorelist = {}
local Vel = Instance.new("BodyVelocity",knife)
Vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
Vel.Velocity = char:WaitForChild("HumanoidRootPart").CFrame.lookVector * 0
local antiGravity = Instance.new("BodyForce")
antiGravity.Force = Vector3.new(0, workspace.Gravity * script.Knife:GetMass(), 0)
antiGravity.Parent = script.Knife
knife.CFrame = CFrame.new(knife.Position, enemy.HumanoidRootPart.Position)
until tick() - Starttime >= 3.5
Does it work when you used knife.CFrame?
Also, since the knife is ALERADY facing the player, why don’t you set the Velocity of the knife to go where the knife is facing instead of setting the Velocity to go where the humanoidrootpart is facing?
umm i tried and it not working umm i want to make the knife move after the repeat
Vel.Velocity = knife.CFrame.lookVector * 60
BodyVelocity.MaxForce only increases the limit of how strong the force can be applied to the part. You also need to change BodyVelocity.P to actually increase the force so that the knife could move.
Also, is the knife anchored? The knife won’t move if it’s anchored. BodyVelocity doesn’t work if the knife is anchored. Like, how is your knife in the air and not falling to the ground in the first place?
umm the knife is not anchored i want to make the knife move after 2 second repeat
Oh, you’re using BodyPosition to keep it in air, right?
1 Like
yep that what im doing to keep it in air cuz timestopped i want to make it after timestop end all knife move
Then, you should destroy the BodyForce (antiGravity) after the repeat because its keeping the knife in that position.
how to destroy all knife bodyforce?
you loop through the workspace and check if the part name is “knife”, then destroy the BodyPosition inside of it
for _, instance in pairs(workspace:GetChildren()) do
if instance.Name == "knife" then
instance:FindFirstChild("BodyPosition"):Destroy()
end
end
thats if you want ALL the knife in the workspace to have their BodyPosition destroyed.
if you have knives at other place and u dont want to destroy their BodyPosition just yet, you should set an attribute for the knife to see who the knife is for.
1 Like