Collisions with world-space widget components

Good evening!

I have a space ship which is represented in-game by a world-space widget. It exists as a child of a sphere collision component for navigation and collision avoidance purposes with the world and other space ships. For this purpose it works fine.

However, projectiles fired at the space ship register a hit on the edge of the sphere. That makes sense considering that’s where the overlap begins. I would prefer to have the collision register on the widget itself, specifically any of the visible parts. Is there any way I can run a line trace or have the hit of projectiles register on the widget instead of the edge of the collision shape?

The simplest solution I can think of: Don’t use a sphere for collision. Create two boxes, and align them to cover the sides of the wedge.

Hey @jwatte,

Thanks for the fast response and the suggestion! I can see how that would work, however, expanding on my initial question, different ships will have different shapes. Additionally, players will be able to mod new ships into the game. While I could require each of them to have collision set up separately, I was hoping for a general solution I could implement in the base class and cut down on the effort involved in setting up derived classes. I will use this as en escape hatch if a generic solution does not exist, but if there is, that would have my preference.

Thanks again!

When building game assets, building collision and physical bodies is just as important as building visible geometry. And users “modding/creating” things, is users “building game assets.” This is one reason why user-generated content is actually hard, and sometimes when some game tries to add this, the end result is glitchy and bad. This is also a huge challenge for anyone trying to do a “metaverse” kind of thing – and generally totally under-appreciated by all the early optimists.