if event.key == pygame.K_SPACE: if are_objects_sleeping == False: for i in objects: i.sleep_with_group(i)
As you can see, when the Space bar is pressed, the objects(body in space) go to sleep.uhh...actually it works, but only for 3 seconds. After all of the objects in space being slept, an error is raised
Aborting due to Chipmunk error: Sleeping is not enabled on the space. You cannot sleep a body without setting a sleep time threshold on the space. Failed condition: cpSpaceGetSleepTimeThreshold(space) < INFINITY Source:Chipmunk2D\src\cpSpaceComponent.c:321)
Is there any way to make bodies in space go to sleep in no errors?
I want to make bodies in space sleep in no errors when I pressed the space bar.