I need urgent help, I am almost 1 week trying to solve a collision bug in my script, after some tests it seems that a “MeshPart” is not possible to detect an NPC, I really need this, I did a test on Player Character and it works.
script.Parent.Touched:Connect(function(hit)
print(hit)
if hit.Parent:FindFirstChild("Humanoid") then
print(hit.Parent,"Humanoid")
end
end)
it shows that the player is touching the block

but when playing on the NPC it doesn’t detect anything or a “HIT”

I already tried to move the “PART” over the NPC even so it does not trigger the Touched ()
only with player.Character
Make sure that you are moving the NPC to the MeshPart via. the SERVER (while playing in studio, go to Test > Server), since my guess is that the script detecting the touch is a server script.
Are both parts you expect to be touching anchored?
The touched event requires that at least 1 of the parts touching is unanchored for it to register it.
no, the rock is anchored and the NPC is not, because it has to run animations
sorry but I don’t understand. 30char
I already tried to do this, it doesn’t work, I have a skill script that creates rocks around the player and damages those who touch it, but it only causes damage to players (Does not detect npc)
They are asking you to check if the part is created server side, or just on the client
the script is on a server 30 chars
1 Like
I will try to explain again. The script with the .Touched event is, I assume, a server script. But when you play in studio and move parts around, you are doing this all from the client, so the server script does not detect any sort of touching. When you are playing your game in studio, go to “Test” at the top of your screen and change “Current: Client” to “Server,” then try moving the parts together.
already tried it, the error remains