is your PhysicsWorld within the scene or within the level?
Make sure your PhysicsWorld is within the same Item that you use as entityContainer (in your case the level seems to be the right choice), or else Box2D would have to deal with 2 different coordinate systems, which can result in colliders appear to be shifted.
You are experiencing this on Android because the devices have a different aspect ratio than on your desktop. Therefore the gameWindowAnchorItem will be bigger than the scene. I suspect your PhysicsWorld is in the scene and the entities are in the level? But since you anchor the level to the gameWindowAnchorItem, the 0|0 coordinate of the scene (and therefore of the PhysicsWorld) has a different position than the 0|0 coordinate of the level on the screen.
Now if your entity has a position of 50|50, the visual representation (50|50 within the level item) won’t match the physical representation (50|50 within the PhysicsWorld which is your scene).
Cheers,
Alex
This reply was modified 10 years, 4 months ago by Alex.
This reply was modified 10 years, 4 months ago by Alex.
This reply was modified 10 years, 4 months ago by Alex.
By signing up, you consent to Felgo processing your data & contacting you to fulfill your request. For more information on how we are committed to protecting & respecting your privacy, please review our privacy policy.
Want to find out if Felgo is a good fit for your company?
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: