CreateDefaultSubobject with UBoxComponent causes crash on startup
I have a class called AWeapon, an actor derived from AItem, in which I declare a UBoxComponent in my .h file and use CreateDefaultSubobject in my constructor in the .cpp file. I forward declare the box component in the header and include the BoxComponent.h header in the .cpp file. When I use CTRL+F5 to launch upon compilation, I get a crash. When I remove the CreateDefaultSubobject call in the constructor, it builds and launches fine. My code:
![alt text] ![alt text]
asked Feb 10 '19 at 02:08 PM in C++ Programming
Feeling really dumb but I realized that I used the arrow -> operator rather than the assignment operator. Now, can someone tell me how to delete a post? haha.
answered Feb 10 '19 at 02:17 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here