A program design question

Hi!

I’m using Unreal Engine 5.3.2.

I’m developing a clone of Tetris game, and I have two levels. In one of them, I use the class BP_Block, and in the other one the class BP_SpriteBlock.

To spawn a block I use this code in the PlayerController:

I’m using the same Game Mode and Player Controller in both levels, because the only different between the levels is that one is 3D and the other 2D.

I don’t know how to pass the corresponding Blueprint class to the method Start Falling Blocks depending on the level we are.

I’ve thought to have a game mode (or player controller) for each level to set the blueprint class. Using a game mode is because I can set it on the level.

Any idea about how to set the blueprint class depending on the level we are?

Thanks a lot!

Using different Game Modes in different levels is not a bad idea.
You can also create a parent Game Mode, and then two offsprings: 2d and 3d. This way you can still do some stuff in parent if you need it in both modes.

2 Likes

Great!

Thanks a lot!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.