Hi! I wanted to make sounds for props when they collide (like in Source games), but the problem is that most of my props are Tools, and CanTouch is disabled in them because they use a custom interaction system to pick them up, so .Touched does not work on them, so impact sounds for them impossible to do. Do you have any ideas about this?
CanTouch is disabled in them because they use a custom interaction system to pick them up
Are you able to enable CanTouch after the tool is picked up? Then disable it again if it’s dropped?
I can, but I don’t think it will help, impacts happen when the item is not in the hands.
I think I see what you’re getting at. Is it possible to create a duplicate model when the tool is dropped? Then CanTouch can be enabled but it won’t be able to be ‘picked up’.
Or weld a transparent non-CanCollide part onto the tool to act as a detector?
It will be difficult to make copies every time, and the detector will take a long time to make for each object.
Maybe there are other ways to block holding an item when touched?
I believe it’s the ‘Handle’ part of the tool that allows it to be picked up. You could experiment with changing it’s name?
I can, but most scripts look for Handle by it’s name.
I tried thing with changing handle name, but there is a bug.
Changed: After changing it’s name the tool is still picking up on touch so this way isn’t works.
Bumping for more activity here.
Try destroying the ‘TouchInterest’ that’s created in the Handle part too just after you change the name. Maybe some of the events are persisting.
I already tried to delete it through the server, not a script, it didn’t help.
Check the video I attached to my previous comment.
ok I’ll try it through the script and report back.
it doesn’t detect touches without touchinterest.
Other objects detect when they are touched by props, so the only option is to detect touches through the objects the prop hits, rather than through the prop itself.
I think its the better way to make it, so ill mark as solution.
Sorry I couldn’t help you find a proper solution. In my opinion the easiest way would be something along these lines:
function Unequipped()
local Tool = script.Parent.Parent;
local newModel = Instance.new('Model', Tool.Parent);
newModel.Name = Tool.Name;
for _,Child in pairs(Tool:GetChildren()) do
Child.Parent = newModel;
end
Tool:Destroy();
end
function Equipped()
local Tool = script.Parent.Parent;
local newTool = Instance.new('Tool', Tool.Parent);
newTool.Name = Tool.Name;
for _,Child in pairs(Tool:GetChildren()) do
Child.Parent = newTool;
end
Tool:Destroy();
end
task.wait(5);
Unequipped();
task.wait(5);
Equipped();
But it’s up to whatever you think is best for your game. Good luck and hopefully it works out in the end.
Already made normal impact sound system. Thanks for your help!
Video: