Touched or Raycast?

I made a stealth bomber that flies over players and when the bombs that are dropped collide with an object, they automatically explode. The issue with this is that the bombs sometimes have a delay and bounce off of the ground, so would it be ideal for me to use raycasting to cast a ray downward from the bomb, so that when it detects a part it explodes instantly instead of relying off of Roblox’s collisions?

I feel like I can also change the collision fidelity, but the .Touched() event is still highly unreliable from what I know of. What do you guys think?

Raycasting might work, but if you want an alternative to .Touched() you can use :GetPartsBoundsInBox(), :GetPartsInPart(), or maybe :GetPartBoundsInRadius(), depending on what you need.

3 Likes

I’ll probably just be using a ray cast considering that these are functions that would need to be used constantly, which may use up more memory than I really need.

1 Like

Raycast will also need to be constantly run ;-;

I’d say use ray casting for distance and PartInBound for collision detection

Yeah, I realized this in the long run, though I’m using GetTouchingParts() for collision detection. Is there a big difference?

Not really they all detect things that are touching either way in the long run

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.