Projectile hit location not accurate

Hello,
I am making a particle effect for when a projectile hits somewhere, but it’s really inaccurate.

Here is a video of it not working (first shot shows the particle effect) :

Here is the particle effect code:

    Projectile.Touched:Connect(function(part)
            local effect = game.ReplicatedStorage.Hit:Clone()
			local sound = game.ReplicatedStorage.Sounds.Other.Impact:Clone()
			sound.Parent = effect
			sound:Play()
			sound.Ended:Connect(function()
				sound:Destroy()
			end)

			effect.Parent = workspace
			effect.Position = Projectile.Position

			effect.ParticleEmitter:Emit(50)

			delay(1, function()
				effect:Destroy()
			end)
			projectile:Destroy()
    end)

what particle are you talking about in the clip? is it the glitter that shows up? if so, it’s probably because the projectile is at the tip of the wand when fired, I would run some tests to see what “Projectile.Position” returns

The particle is in fact the glitter. But I doubt it’s at the tip of the wand when fired, because the glitter doesn’t show on the wand most of the time.

what happens when you remove the delay? Is it possible when you attack fast enough or click that it effects the rest of the script? also I would suggest move the sound.Ended to the end of the function, idk if that affects it either or what not

also I would think that the projectile is in the wand. Maybe activating the spell removes something vital in the process that you’re unaware of, preventing it from happening more than once? if you tried testing it again will it only work on the first try?

Removing the delay doesn’t seem to do anything… Neither did the Sound.Ended.

try testing it again and tell me if the particle does the same thing where it only works on the first attempt

The first attempt thing was just a coincidence. And I tested both techniques you talked about

effect.Parent = workspace
print(effect.Parent)
effect.Position = Projectile.Position
print(effect.Position)

try this and see what it returns. my best suggestion for you is to just use a bunch of print statements and figure out where it’s breaking

The position of the effect seems to be the wand tip’s position…

When I print Projectile.Position == effect.Position it always says true. So I think the problem is that the projectile might be somewhere different than the client sees it or something.

if you are using raycasting for the projectile, you need to use a blacklist if you are not already. It is probably hitting the tip of the wand and therefore returns the first spot it hit? but then again it seems like your spells ray works just fine so i’m not sure.

I am not using raycasting, because I am using the .Touched event. I am using a body velocity for the projectile. Maybe that could be causing some issues?

Adding on to this, the projectile works fine besides the particle effect. When a player/npc gets hit it does the correct thing

yes that definitely is. try printing Touched.Name for the projectile and see if it returns the wand or the tip of the wand. I’m assuming that might be causing some issues

I apologize for leaving out a bit of code, but I made a check so it returns if the parent of the part is the character, any character accessory or the wand, and it does work.

so you are saying that it is working now?

It’s not working, the effect is still inaccurate, but the part that’s touched is not the tip of the wand. I even made a print statement and this is what it says:

is what you are printing there projectile.touched ?

Yes, it is. I am printing what it returns in the function.

ok, and what exactly is projectile