[help]collision Object Feels Weird On 2d Object

Discussion in 'Buildbox 3.0' started by nyamuk91, Dec 28, 2018.

  1. nyamuk91

    nyamuk91 Boxer

    Joined:
    Aug 15, 2018
    Messages:
    95
    Likes Received:
    20
    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
     

    Attached Files:

  2. Tom King

    Tom King Boxer

    Joined:
    Nov 23, 2018
    Messages:
    24
    Likes Received:
    15
    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.
     

    Attached Files:

    nyamuk91 likes this.
  3. nyamuk91

    nyamuk91 Boxer

    Joined:
    Aug 15, 2018
    Messages:
    95
    Likes Received:
    20
    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?
     
  4. Codifie

    Codifie Avid Boxer

    Joined:
    Apr 17, 2018
    Messages:
    364
    Likes Received:
    190
    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.
     

    Attached Files:

    nyamuk91 likes this.
  5. Tom King

    Tom King Boxer

    Joined:
    Nov 23, 2018
    Messages:
    24
    Likes Received:
    15
    Turn on Debug mode & you'll see the problem. It's a bug with the Sphere Collision object scaling I'm reporting to support.
     
  6. nyamuk91

    nyamuk91 Boxer

    Joined:
    Aug 15, 2018
    Messages:
    95
    Likes Received:
    20
    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?
     
  7. Codifie

    Codifie Avid Boxer

    Joined:
    Apr 17, 2018
    Messages:
    364
    Likes Received:
    190
    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!
     
    nyamuk91 likes this.
  8. Codifie

    Codifie Avid Boxer

    Joined:
    Apr 17, 2018
    Messages:
    364
    Likes Received:
    190
    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.
     
  9. Tom King

    Tom King Boxer

    Joined:
    Nov 23, 2018
    Messages:
    24
    Likes Received:
    15
    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.
     
    nyamuk91 likes this.

Share This Page