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

Alternatives for .Touched for a projectile-based weapon?

Currently, my weapon (a rocket launcher) has an issue where the damage will be randomly reverted purely due to how buggy the .Touched event is. Is there any other alternatives I can use for a weapon that fires a slow projectile? I've been trying to use raycasts, although I don't think they are the right tools for the job. My weapon also has things that the missile must not collide and must collide with (such as some non-collidable objects that the missile must collide with).

Are there any other alternatives?

4 comments

0

I'm assuming you're using CFrame to move the rocket?

0

Fix the script so that damage is not reverted.

0

No, I'm using forces to move it. And no, I can't fix the script - the .Touched event is causing the issue.

0

If you want to prevent it from "bugging," and if you didn't add already, try putting in a debounce. http://wiki.roblox.com/index.php?title=Debounce

1 answer

        [ROCKET NAME HERE].Touched:connect(function(hitpart) 
            print("checking")

            if hitpart.Parent.Name ~= player.Name and hitpart.Parent.Parent.Name ~= player.Name then 


[FUNCTIONS HERE]


end

Hope this helps!

1 comment

0

That's the only thing I got so far, it doesn't bug out for me.

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