Making a project where will be many different attack mechanics many of which may have custom check for hit collision shapes. Basically I'd just use custom shaped collisions like ConvexPolygonShape for each attack that requires custom shape but spells in my game are dynamically changed, for example player may receive debuff that lowers spell distance, range or angle of melee attack and so on.
So I'd like to know what is the most efficient way of making such mechanics including drawing collision shape on floor so player can see actual hitboxes of those spells?
#MOBA like dynamic attack collision shapes (with spell indicators)
4 messages · Page 1 of 1 (latest)
I'd say use the closest collision shape that covers the largest possible range that you allow and then write code to filter out objects based on your dynamic criteria.
For example from second screenshot: use sphere or cylinder collider with radius that you need, store the arc angle. When you need to check if your area effect hits the target check if it hits the sphere collider AND that it lies inside the circle section given by angle.
As for rendering, for static visuals you can use decals. For a dynamic visual you'd need to somehow project some geometry on top of the ground and draw whatever you need with a custom shader. I'm not the person to ask how to do that, but I think that's the general approach.
Pay attention to your examples. While they seems fancy, they are all simple shapes you can do with standard collision shape
As for display, use decal
Malz Q: Rectangle
Cassio R: Triangle
Thresh E: Rectangle