28-05-2024, 02:00 PM
In my game player is creating softbodies in runtime. Now, when it happens game lags a little. I assume its happens because at the moment of softbody creation obi solver does not have needed amount of particles and it creates new ones. Can I somehow tell obi solver to create some amount of particles at the start of the game? Im already using object pool for softbodies but even though Im instantiating some amount of softbodies at the start and releasing them but solver does not create particles for them probably because Im creating and releasing softbodies too fast. My current solution is to instantiate softbodies at the start and after 1-2 frames release those softbodies. This way solver is creating needed particles and game does not lag on creation of new softbodies