Floor composed of small cubes, when the cubes overlap, they move in sine pattern. How to optimize this?(The more the cubes moving, fps drops)

I have this test level, with a platform composed of small cubes. If a cube is overlapping, it will move with a sine pattern. But if there are too many cubes getting overlapped, the performance drops. And i want to make the cubes even smaller. Is there a better way to do this?

Many things

. Use a timeline, instead of tick and vector calculations

. Don’t use ‘get actor of class’ on tick, you already have ‘end overlap’

. Use a custom collision channel for the cubes, or edit their collision so they only look for your player, instead of ‘world dynamic’, the default.

. Use particles in a cube shape, instead of blueprints. Could be quicker, although probably takes a long time to get it working.

. And of course, do it in CPP :slight_smile:

If you don’t need the collision when moving then try a dynamic material instance with WPO.

Quick example:

The BP with a grid of 2,500 HISM cubes.

The material

CubeGrid

1 Like

Thank you for your answer. But i have a few questions.
What do you mean with “use a timeline”?
what about the end overlap? how do i replace the get actor of class?

I would look at the @pezzott1 offering first :slight_smile: