How do i check if two anchored uncollideable parts are intersecting?

  1. What do you want to achieve? Keep it simple and clear!

I’ve been trying to make a tool that shoots various star shaped bullets in a circle, these are anchored so that i can tween them foward without them looking weird, and uncollideable so they dont act like blocks that can be jumped on, then i made a sound play when it touches a character, however, Touched events don’t work if two of the parts intersecting are anchored, so i would like to know if there is a way to check if anchored characters and these anchored bullets are touching so that it can play a sound.

  1. What is the issue? Include screenshots / videos if possible!

As i said before, Touched events don’t fire if both of the parts touching are anchored, which makes the sound unable to be played via collision.
I’ve also tried using the BasePart:GetTouchingParts() function for checking if a part was touching the bullet, but that didn’t work either since the function returns an empty table if the basepart is uncollideable

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I tried to weld another unanchored star to the original bullet to see if the collision would now work since this one is unanchored, but it seems that welding it to the bullet makes it register as anchored, because the Touched event over the secondary star didn’t fire on this situation. I used a regular Weld and a WeldConstraint, both with the same result

I tried using an unanchored star bullet with a body velocity to replace the tween, however it lagged too much, so i decided to keep the bullet anchored since it doesnt lag

I saw a RaycastingHitbox Module script and i used it in my star bullets, replacing the Touched event, and it did everything it was supposed to, and even played the sound after touching an unanchored dummy, but it still didnt play the sound after touching the anchored character, so that didn’t work either.

1 Like
function intersecting(part1, part2)
	local parts = workspace:GetPartsInPart(part1) 
	if table.find(parts, part2) then 
		return true 
	else 
		return false 
	end
end

print(intersecting(workspace.Baseplate, workspace.SpawnLocation))

Thank you, it worked.

However, i would need to check what parts are colliding with the bullet several times since the bullet will be in constant movement, is there any way i could check if another part began touching the bullet without needing to use a while true do loop? I’m afraid that would lag my game.

If your bullet is anchored, you move it using a script, so every time you update the bullet position inside that script run intersecting(part1, part2) although I consider raycasting from the bullet a better solution(and probably less expensive).

That should work.

Thanks for the help!

Question How Would I Put This In A Loop Without Lagging The Game?