Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Alternatives for .Touched for a projectile-based weapon?

Asked by 7 years ago

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?

0
I'm assuming you're using CFrame to move the rocket? OldPalHappy 1477 — 7y
0
Fix the script so that damage is not reverted. cabbler 1942 — 7y
0
No, I'm using forces to move it. And no, I can't fix the script - the .Touched event is causing the issue. coolyoshipower 42 — 7y
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 TheeDeathCaster 2368 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago
        [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!

0
That's the only thing I got so far, it doesn't bug out for me. Shadowthaumaturge 97 — 7y
Ad

Answer this question