Sebell Posted August 23, 2018 Share Posted August 23, 2018 Hi, I'm working with Babylon.js to make a Facebook Instant Game and I was wondering if this issue happened to someone before me. My main object is a ball that I want to kick. My problem is that it always displays in front of all my other meshes. For example, if the ball lands behind a tree, the ball will appear above the tree in the screen. I used to work with rendering groups and have my ball be in the fourth group (renderingGroup = 3). I now know that this group appears above everything else. Consequently, I tried removing all the rendering group from every mesh but the issue still appears, the ball displays before everything else. Is there some configuration I should make in Babylon.js so that every mesh displays according to their 3D position? Best regards! Quote Link to comment Share on other sites More sharing options...
brianzinn Posted August 24, 2018 Share Posted August 24, 2018 It's the default behaviour to display according to the 3D position (there are exceptions like glow/highlight layer/full screen UI/etc). The 3D position for render order is determined by the distance to the camera. If you have a huge bounding box on your ball then I think that will be used to determine "depth" in the scene. You can show the bounding box with ball.showBoundingBox = true If that doesn't help -- make sure to ask this question in the main BabylonJS forum as this does not appear FB specific and this forum is not monitored by their team. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.