My goal is to make a granade that when explodes it sends out a straight line of lightning toward anything that is metal. So how can I send out a raycast3D from the granade object toward any object that is in the target metal group?
I want the lightning range to be really big so its probably not a good idea to use an area3D cause it could lag probably?
An area 3d would would not cause any lag and you if you still wanted to use the raycast 3d method you make the raycasts, make a script where on contact make sure its an enemy, if it is do damage , if not do nothing. (But an area 3d would probably work fine but let me know if im wrong)
You could use a different collision layer for your metal objects. It’s a bit more manual work to also set things into the correct layer. You could try and script this, by checking the group and automatically setting the collision layer (I’m not entirely sure where/how the best way to do this would be, but it’s certainly possible).