Forums

OverviewV-Play 2 Support (Qt 5) › Is it possible to make a BoxCollider rounded?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #10783

    Cícero

    Hello guys,

    first of all, I would like to thank you for the great support so far.

    Second of all…    I am having some problems during my game project due to the corners of the BoxCollider. To make it clear… imagine that the floor in my game consists of many entities that use BoxCollider to detect collision. These entities are placed horizontally and my main character walks over them.

    The problem is that sometimes one of these entities is a little bit rotated, and my character’s BoxCollider collides with the floor horizontally (due to the corners being in contact).

    How can I solve this problem elegantly? I believe it would be great to have a property on BoxCollider called radius, it would behave like the Rectangle.radius from QT documentation, making the shape a little bit rounded on the corners.

    Thank you again.

    • This topic was modified 2 years, 9 months ago.
    #10787

    Günther
    V-Play Team

    Hi CiceroDev,
    thanks for your praise, we love that! 😉

    As we use the Box2D physics engine, the colliders available in V-Play are based on the Box2D colliders. Unfortunately, there’s no easy way to get rounded corners, because a radius setting similar to the Qt Rectangle is not supported for the BoxCollider currently.

    You can try using a CircleCollider or PolygonCollider to get the shape you want. The CircleCollider uses a full circle, so it might not be the best if your base shape is more like a rectangle. With the PolygonCollider you can create your own custom shapes, for example an octagon shape, so the edges are cut off.
    Best,
    GT

    • This reply was modified 2 years, 9 months ago by  GT.
Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support