Question About Raycasts

I dont know if this is the right category

So, im making a tower defense game, and im working on improving gun system
And i’ve got a question

After the raycast hits its target, does it goes through and continues? or just stop when it hits

1 Like

Rays stop whenever they make contact with their first target, unless the target is ignored by either being in the ray’s ignoreDescendants variable, or by having the CanQuery Property disabled.

So if i have the CanQuery property enabled then it goes through even if it hits the target?

If the CanQuery Property is disabled then I believe so.

1 Like

This property lets you determine if the part will be hit by spatial queries, such as raycasts or bound overlap checks. A part that has CanQuery set to False will always be ignored by spatial queries, even if the part is whitelisted.

ohh now i understand it, just what i needed