Im making a brick breaker like game and when I try to remove the brick, I remove the sprite, but not the collision. In new to HaxeFlixel so I don't have a clue why this is happening. Can somebody please help me? (code below)

Im making a brick breaker like game and when I try to remove the brick, I remove the sprite, but not the collision. In new to HaxeFlixel so I don't have a clue why this is happening. Can somebody please help me? (code below)

Copyright © 2021 Jogjafile Inc.
The
remove()function removes the object from the state, which is causing the odd behavior. You only want to disable the object.Try changing the line
remove(brick)to insteadbrick.kill()and see if that resolves your collision problem.