Godot Version
godot 4.5
Question
i’m making an fps, and i’m trying to make a shotgun using a single raycast whose target position changes to emulate the pellets, but i’m stumped on how i can make the shotgun hit multiple enemies at once, i’ve tried putting the enemies in an array and dealing damage then, i’ve tried dealing damage in the for loop (the one that controls the pellets) but i’m just not really figuring this out, does anyone have any ideas? thanks
Why are you using a single raycast? That doesn’t say shotgun to me. I would expect either multiple raycasts going out in a cone (one per pellet), or an actual area cone and every enemy in that cone is hit.
1 Like
the thing im worried about multiple raycasts is that it might get really messy to deal with (but honestly you’re probably right ) and the thing with a shapecast or an area3d is that i have no idea at all in how the bullethole decals would be applied
Use PhysicsDirectSpaceState3D::intersect_ray()
The recipe is in the docs: Ray-casting — Godot Engine (4.5) documentation in English
1 Like
thank you thank you sorry for the trouble!!