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

My Part prints 'Bruh' when I touch it, but not in other cases. How do I fix this?

Asked by 4 years ago

I have a gun that shoots a projectile (It clones the projectile and then sets bodyvelocity to go in the direction of the cursor)

The original projectile prints 'Bruh' whenever I touch it or drop a part on it, but the cloned projectiles that my gun shoots out dont print 'bruh' whenever they touch anything. (Cancollide on the projectile is off)

local Boop = script.Parent
local function sayhi()
    print("bruh")
end

Boop.Touched:Connect(sayhi)

Does anyone know what the cause of this is, and how can i fix it?

0
When you clone the projectile or so, be sure the script is in it so it gets cloned as well Shawnyg 4330 — 4y

2 answers

Log in to vote
1
Answered by 4 years ago

Debounce may be the problem you may need to fix. You may also have need to turn cancollide on.

Or do a wait(1)

1
Can collide doesn't have to be turned on. ScaleisRed 58 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

A wait should fix it wait(1)

0
You almost copied my reply ArtyomAL3X 12 — 4y
0
Sorry, but this sometimes developers have the same idea. AwesomeMrBird -79 — 4y

Answer this question