.Touched Event not Firing when Supposed to?

I don’t quite know why this is happening, I have used .Touched so many times, but there seems to be about a .2 second touch delay (not really delayed because it’s in advance but you get the point). Here is a video of the problem:

Touch Delay

The Ball is meant to touch the ground then get destroyed, as you can see in the video ,that is not what is happening.

Here is the segment of code that is giving me trouble. You can disregard most of the other stuff, such as the magnitude and measuring, I am going to be using that later.

local giantFireBall = game.ReplicatedStorage.Powers.MHA.GiantFireBall.spawn
local mouse = game:GetService("MouseService")
local fireBall = game.ServerStorage.Powers.MHA.giantFireBall.FireBall

giantFireBall.OnServerEvent:Connect(function(plr, plrPos, hit)
local fireBallClone = fireBall:Clone()

local maxMag = 200
local plrMag = (hit - plrPos).p
local magnitude = plrMag.magnitude

fireBallClone.CFrame = hit * CFrame.new(0, 100, 0)
fireBallClone.Parent = workspace.magic

fireBallClone.Touched:Connect(function()
	fireBallClone:Remove()
end)

end)

your not cloning giantFireBall.

local giantFireBall = game.ReplicatedStorage.Powers.MHA.GiantFireBall.spawn:Clone()
giantFireBall.Parent = workspace

The “spawn” is just an event that I have stored in Replicated Storage, my FireBall I have stored in ServerStorage. I really could’ve named that better lol, I was just typing things up.

Can you add some prints so that we can see what it is “hitting”.

fireBallClone.Touched:Connect(function(hit)
        print("Hit by: "..hit.Name)
	fireBallClone:Remove()
end)

I have tested this a few times actually, it everytime says it is hitting the baseplate.

1 Like

:Remove() is a deprecated method that likely no longer functions properly. Use :Destroy() instead.

1 Like

I just tested this, still doesn’t work. Although, I still do find it very useful to know this. Thanks.

Edit: Forgot to mention I also used the game.debris:AddItem() function, that didn’t work either.

1 Like

I am not sure if this helps anybody, but I just discovered that the ball is getting destroyed as it hits the ground. I have it so it prints the position of the ball every time the ball touches the ground, and it is always at ground level. Possibly some sort of lag on studio? I reset my computer and studio, yet the problem persists.

are you using body movers?
If so, that’s probably the reason why. I can’t really explain it well, but the physics are wack and although the fireball does hit the baseplate, it is not the same as what the player would see. Try setting the projectile’s network owner to the server. “fireBallClone:SetNetworkOwner(nil)” This has to be called after it is parented to workspace.

https://developer.roblox.com/en-us/articles/Network-Ownership
Or better yet, use FastCast. It may be a struggle to learn it at first, but I highly suggest using this over any body mover if you want precise hits.

1 Like

Thanks! I will definitely check out FastCast tomorrow, seems like a very useful module to use. Also with the Network Ownership, that didn’t quite work, but it very good to have later on down the line.

Update After playing around with FastCast for a little while I was able to make it so the ball accurately touches the ground and gets removed at the proper time. I am going to continue and try to master fast casting since it proves to be very useful with projectiles and the ROBLOX physics.