Fixtures are not attached to body correctly

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
Bannana97
Citizen
Posts: 77
Joined: Wed May 16, 2012 2:49 pm

Fixtures are not attached to body correctly

Post by Bannana97 »

I'm having an issue with Box2D.
For some odd reason, as shown in the screenshot below, objects aren't colliding correctly.

Snapshot:

http://sufr.in/i/lRfW50x.png - See how the ball isn't touching the ground? Well, that gray block does this at random times, no idea why.

Could someone review the source and see what's up?
Last edited by Bannana97 on Mon Jun 04, 2012 5:44 am, edited 1 time in total.
User avatar
Boolsheet
Inner party member
Posts: 780
Joined: Wed Dec 29, 2010 4:57 am
Location: Switzerland

Re: Fixtures are not attached to body correctly

Post by Boolsheet »

The ball isn't touching the ground because there are bodies under it that don't get drawn.

Instance.new calls the setup function with the default values of the object. The :update() method then calls the setup function again, apparently with the correct values.
Shallow indentations.
Bannana97
Citizen
Posts: 77
Joined: Wed May 16, 2012 2:49 pm

Re: Fixtures are not attached to body correctly

Post by Bannana97 »

Okay, so on update() is there a method to remove the old body?
Bannana97
Citizen
Posts: 77
Joined: Wed May 16, 2012 2:49 pm

Re: Fixtures are not attached to body correctly

Post by Bannana97 »

Thanks, everyone here rocks. I LÖVE this.

I used :destroy() to remove the old bodies if exist. Now, tons of bugs are fixed and I got callbacks working.

Thanks so much! <3 <3 <3
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests