Slow moving box2d bullets

Anything libgdx related goes here!

Slow moving box2d bullets

Postby carterza » Fri Nov 18, 2016 1:59 pm

I'm spawning bullets in my game and they're moving extremely slow - http://i.giphy.com/3o7TKVX84bd9LrBykU.gif

In the gif, the radius of the circle is increase so you can see the debug boxes, but if I decrease it to like .009, it still moves way way too slow.

Here's the code I'm using to spawn the bodies and move them, also included my physics system initialization code -

https://gist.github.com/zacharycarter/1 ... d698f27a03

The floor tiles under the bullets are NOT physics bodies, so there should be no interaction between them and the bullets. Why are these things moving so slow?

Thanks!

-Zach
carterza
 
Posts: 5
Joined: Wed Sep 21, 2016 1:35 pm

Re: Slow moving box2d bullets

Postby evilentity » Fri Nov 18, 2016 2:47 pm

Box2d has a speed limit. Since your circles have radius of one, and are like one pixel on screen, you are probably hitting it.
Looking for a freelancer? PM me!
Check out libgdx discord server!
evilentity
 
Posts: 4867
Joined: Wed Aug 24, 2011 11:37 am

Re: Slow moving box2d bullets

Postby carterza » Fri Nov 18, 2016 3:22 pm

I divided my viewport width and height by 24 since that's the size in pixels of one tile in my game.

If I'm hitting the speed limit - what do I need to do to make these bullets not look like they're moving at 10 feet per second? I tried increasing their radius to 10M and increasing / decreasing their density. Nothing changes. They're still slow.
carterza
 
Posts: 5
Joined: Wed Sep 21, 2016 1:35 pm

Re: Slow moving box2d bullets

Postby Kyu » Fri Nov 18, 2016 7:45 pm

You have a ratio of 1 meter per pixel in your physics world, increase this ratio like 64 pixels for 1 meter your speed will be visually increased.
Kyu
 
Posts: 390
Joined: Wed Aug 07, 2013 7:35 pm


Return to Libgdx

Who is online

Users browsing this forum: Google [Bot] and 1 guest