Unreal Engine's class comparisons


Dev: Jacob Zhu

Here is an issue that Unreal Engine presents to anyone doing data checks: 

How do we prevent class inheritance from affecting specific programming that we are trying to implement?

To elaborate, I have ran into two scenarios whereby the classes have caused checks to go through since one class has inherited from another.
First is when we want to make sure that it is the player character that is triggering the spawn proximity volume, and nothing else. However a bug was being cause where by the player's flashlight, which is a player component, triggers the check as well when it is spawned, despite being a simple box volume. The below is the method I found in Unreal that prevents this occurance, by specifically checking for only the player character's capsule collider, on top of checking for the player itself:


The other scenario was when I was setting up a map for validating the spawn point's required AI class, and the AI pool it's supposed to take the actor from. This is the solution I came up with which is also inherent to Unreal Engine, so that only classes of itself or its children, and not the parents, pass through:


Get Lustrat Somnia

Leave a comment

Log in with itch.io to leave a comment.