Projectile hit location not accurate

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

Just a part with some values, a trail and a BodyVelocity

Your problem here is that the Baseplate’s Position is in the center of the baseplate. So the projectile lands there. Do not use touched, use raycasts instead.

Here’s an example. I will not write code for you. Use this basic code and work off of it, or make your own unique solution.

function rayCastforwardWithIgnoreList(part, ignore)
	local r = workspace:FindPartOnRayWithIgnoreList(Ray.new(part.Position, part.CFrame.lookVector * 3), ignore)
	if r and r.Instance and r.Position then
		return r.Position
	end
end

function on_Update()
	local lol = rayCastforwardWithIgnoreList(part, {workspace.SomePartWithItsDescendantsThatYouWantToIgnore})
	if lol then
		part.Position = lol
		-- anchor the part
	end
end

2 problems.

  1. I am making a projectile raycasting instantly gets the position.
  2. I have shields that deflect the projectile and it would be really hard to get the raycast of where the deflected projectile will end up.

Also, I am using the projectile’s position when it lands. Not the part it hit’s position. Therefore, it doesn’t end up where the part’s center is.

no. Thats not how it works.

if you need me to fix these problem for you, PRIVATELY DM me a place file with your (so randoms wont have your code).

if not, follow my advice on my previous post.

By the way, whats going on with my raycasting thing is it only raycasts in a small proximity

as soon as the projectile lands set the position of the projectile to a variable maybe that will help

I don’t think you understand. Try reading the rest of the messages in the thread.

I’ll try that. I never thought of that lol

It partially worked. The hit position is still really not accurate, but the particle effect is not going to the wand tip anymore!

No. I understand.

Have you set an ignore list?

also, I am telling you the raycasting thing because you SHOULD NOT USE TOUCHED.

Storing it as a variable will not help either