Ghost bodies after release

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Lattay
Prole
Posts: 3
Joined: Wed Aug 03, 2022 6:32 pm

Ghost bodies after release

Post by Lattay »

Hello,
I am trying to build a small physics-based game, and at some point I need to convert a kinematic body to a dynamic body.
I also need to move the center of mass, and then also shift all shapes. All things considered, it appeared simpler to basically create a fresh body with a fresh collection of shapes and fixtures, just copying what I needed.
Then I call release on each old fixture, each old shape and the old body, and overwrite the references to them.
That seemed to work well until I realized the old body turned ghostly and still cause collision.
Since I don't have any reference to the old objects, I suppose the world object have.

How am I supposed to clear these objects properly?
The only thing I found searching for this problem was to call destroy, which have been removed long ago.
Lattay
Prole
Posts: 3
Joined: Wed Aug 03, 2022 6:32 pm

Re: Ghost bodies after release

Post by Lattay »

Nevermind, I just realized that destroy have not been removed from Body, only from Shape, I misread the documentation unfortunatly.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 148 guests