it didn’t touch the baseplate if you look at the out put it said “part” that means it touched the part that was thrown at
new_kunai.PrimaryPart.Touched:Connect(function(hit)
if not hit:IsDescendantOf(character) then
print(hit)
body_velocity.Velocity = Vector3.new(0,0,0)
new_kunai.PrimaryPart.Anchored = true
end
end)
that actually work, when i reduce the speed to 20 or 50 it works fine but if i go above that the same problem will happen again. but i need it to go a least 100 speed or it’s too slow
Mkay, so we identified our issue, now we are looking for the solution.
My only thoughts are making a delay between the Touched event firing and setting the Velocity to 0, using a wait. But, this seems like it’s unreliable and inaccurate.
I’m going to do some research on it, and let you know what I find.
Another possible solution is making the hitbox a bit smaller, so that it’s from the end of the handle to the start of the blade. But don’t make it go through the blade. Let me know how that works.
This solution is a little clunky, but what you could try is making it so that if hit.Name == part then return. The only problem is you’d have to make sure nothing it could collide with is named part. I don’t recommend this as a long-term solution but it might work for now.
Or maybe try turning canTouch off for every part of the knife except the main hitbox.
I don’t see anything wrong however try doing this to avoid memory leak :
local Conn
Conn=new_kunai.PrimaryPart.Touched:Connect(function(hit)
if not hit:IsDescendantOf(character) then
print(hit)
body_velocity.Velocity = Vector3.new(0,0,0)
new_kunai.PrimaryPart.Anchored = true
Conn:Disconnect()
end
end)
Also you could try changing the Hit detection to raycasting or GetTouchingParts.
Oh well thats a replication issue , I would suggest to set the network owner of the Kunai as the Client , handle the physics in client and detect the hit in client . Once it hits a character fire a remote event to the server and do some sanity checks to prevent exploiting, and in the client stop the movement.
from my experience of making an arrow i found that my arrow was hitting the player which resulted in it being in air so i guess it might be the same problem with you where its hitting the character and stops