Touched()Not Working As Intended after switching Surroundings

so i recently made a energy-slash move, and i want it to disappear when it hits something, at first it works, but as soon as i change the map it seems to working weirdly, i made the script print out all the parts it touched, and it shows that all the parts it touched was my players part, but the mesh is already far away, and this all works fine until i changed the map, maybe its becuz of roblox’s update??
the way it should be working:
https://gyazo.com/83a98fc932166a1d758267e9cf5f4683
https://gyazo.com/9595e129dea6ef751ad60001dd1f35ad
the way it works when i changed map:
https://gyazo.com/c9ed35ac5984c62ac945721f76fcedd4
https://gyazo.com/36dac98b427ec72afde66fee4dbdcb20
here’s the touched script:

local function touched(hit)
			if c:FindFirstChild("Mu")==nil then return else
				if hit:IsA("MeshPart")or hit:IsA("Part")or hit:IsA("UnionOperation")or hit:IsA("WedgePart")then
					if hit.Parent:IsA("Model")==nil then  return else
						if hit.Parent:FindFirstChild("Humanoid") then print(hit)print("TargetHumanoid") return else
							if hit.Parent == c or hit.CanCollide == false then print("TargetCantCollide")return else
								print(hit)
								wait(.1)
								if c:FindFirstChild("Mu")then
									c.Mu:Destroy()
								end
							end
						end 
					end 
				end
			end
        end

It works for me, i dont know how you got it not working. Maybe glich or something, idk, restart studio…

yeh i thought it was too, since the whole script was a copy of my other working one but for the last two days i’ve been working on it so i dont think its a one-time glitch or something like that

i would like to help but i donk know how…
Im sorry…

its ok thanks for effort rlly do :pray: :pray:

1 Like

Looks like there are alot of :IsA() make sure the map u changed it to have the same parts like a mesh part or union operation or Mu wherever it is in ur script.

yeh sadly i checked it multiple times, cant find any real errors on the map side, but thx for the advice tho :grinning:

if u dont mind me asking what is c?

c is the player’s character, sorry for late response, didnt thought anyone would still saw this
and i actually finish the move myself already, but its in a rlly odd way and i dont recommend anyone to do it like that so i wont add the solution yet

FINALLY, after countless of attempts trying to figure out the problem, i finally found what’s causing the problem, its becuz when im scripting a moving part i used CFrame to move it instead of Velocities, and it somehow glitch out the system, hope this helps someone out :smiley:

1 Like