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
Lustrat Somnia
Horror game with horde defence
Status | Prototype |
Authors | The Vermilion Chocobos, Sun, Ren, TheCephaloDev |
Languages | English |
More posts
- Winning randomNov 18, 2023
- Components Vs ActorsNov 10, 2023
- UI subsystem abstractionNov 03, 2023
- UI versus Shared PointersOct 28, 2023
- AI Accidental MartydomOct 23, 2023
- Clashing systemsOct 20, 2023
- Positioning a randomized objectOct 16, 2023
- Dev Log: Issues with Turning MeshOct 14, 2023
- UI Player Feedback and DirectionOct 14, 2023
- DevLog: Point System and Random ItemsOct 07, 2023
Leave a comment
Log in with itch.io to leave a comment.