How do I create an instance of a class in C++?

Hey everyone. so I’ve been working on this tetris program and right now I’m working on making a grid of BoxCollisions that will act a sort of detection system to see if there are any complete rows. To do this I made a separate C++ Class called TetrisGridPiece and is basically a standard Box Collision component with some detection code. Then I made another class called TetrsiGrid (I know I spelt Tetris wrong) which is the entire grid. Within that class, each row of the grid would be packed into an array. I was just wondering how would I be able to generate instances of another class in C++? Thanks. If you need any clarification on anything, please ask.

1 Like

You do this this way (only in UE4 as normally in C++ you use “new” operator, bit UE4 operates objects diffrently):

NewObject<UClassName>()
1 Like

Uhh just wondering could you give me an example of this being used. I tried to use it and it crashed my project every time. =/

1 Like