well im not using any blueprints right now im trying to get the ABackpack class from another cpp file and attach it to the character. when i ran that bit of code it gave me an unhandled exception
What it does is that it attaches your ABackpack’s root component to the ACharacter’s root component.
In fact, actors aren’t attached to each other, their root components are.
You would need to debug things a bit with visual studio but i’m pretty sure “bp” must be null, or your ABackpack’s root component is also not initialized.
here is all the code between character and my jetpack class in case your wondering i switched to jetpack but same concept and problem Link to source code
EDIT: jet is not a property, so either you add the UPROPERTY() macro to your jet member, either you create your jet member with a simple new() allocator. The simplest solution is to replace line 97 by: