I'm making a 2D game in BB3 but I couldn't get a proper collision shape for my object. I have a circular object in my scene and I used Sphere collision shape for it. I resized the collision shape to fill the circle. However, when I play the game and turn on debug mode, the collision didn't fill in the circle. Pic: https://i.imgur.com/fDS5j1P.jpg
This looks like a bug. The sphere collision object doesn't scale properly. I'll report it. Here's the file I modified to work. You are better off using a cylinder collision object anyway. That works well. Also, look at the Position & Rotation Factor settings in the white-overlay.png Object's Start Node. These will keep the physics results in the 2D plane.
Also, if I added an "If Collide" nodes, why there's another layer of collision? I'm not familiar with 3D game development so I might miss something. Is this ever explained?
I took a look at your attached file. Looks like you are doing things right. I did a bit of an example for you using your file and your objects. Hope you can see how it works from what I did.
Turn on Debug mode & you'll see the problem. It's a bug with the Sphere Collision object scaling I'm reporting to support.
Thanks. Correct me if I'm wrong, so u basically increase the collision size to be larger than the object itself? Also, any idea what is the significance of the "If Collide" collision layer on top of the "Start" layer?
I increased it just so it would show for you. You can decrease it. Basically make it the same size as your object and things will still work. As for the sphere you are seeing when you use the Collision node in 2D, that is just showing you the collision shape used by the collision node. It is confusing I agree, but think of it as a graphic representation of what the collision node is expecting. The Start layer will always appear when you use the Collision node for any object. You are on the right path!
I didn't turn on debug mode when I tested this, but I see what you are talking about. Not sure if it is a bug or if it is something they just haven't gotten around to yet since this is beta and this is using the 2D aspect of Buildbox 3D, since I noticed after turning on Debug mode that it is using a 3D collision on a 2D object. It doesn't seem to affect the operation, but could if in the right situation I suppose.
The collisions are all 3D at the moment. You have to manually turn off Z axis per object for now. The same thing occurs if you use a sphere basic asset and try to scale the collision object in one axis. I have sent a report in to see if it is a bug or intended behaviour for the sphere collision object.