Forum rules - please read before posting.

proper use of capsule collider and rigidbody?

Hi Chris,

I am testing 2D (sprite) character setups in a 3D game. I've followed the instructions provided in AC's tutorial "Making a Unity Sprite-based Character (for 3D)" and ran into an issue. Specifically, when adding components to my game object, the tut states adding among other things, a "capsule collider" and "rigidbody". Since the game is 3D, is this why I should add a capsule collider rather than a circle collider? Same question for rigidbody vs rigidbody 2D? By way of background, I've been testing a 3D scene using Brain2D, which works great, though, I ran into movement and and animation issues strictly following the tutorial. Since Brain2D's prefab works fine in my 3D scene, I've been comparing the setup and see that Brain2D uses circle collider and rigidbody2D... I suppose this is because Brain was intended for the 2D demo rather than a 3D game. I suspect there is some other settings that I've missed and causing my custom sprite player from working properly by following the tutorial. I tested by editing a copy of the Brain2D prefab and replacing with my own controller and art, and it works perfectly. So, at the end of the day, I was wondering what implications or potential issues there may be in using a capsule collider vs circle collider and rigidbody vs rigidbody2D in a 3D game. Sorry for lengthy post. Thank you in advance!

Tom

Comments

  • edited October 2019

    A 3D scene is made up of 3D geometry and colliders, with the characters being able to move freely in all 3 axes.

    Unity's 2D physics components (i.e., Rigidbody 2D and Circle Collider 2D) will only respond to 2D colliders, and only work in 2 axes.

    When you move Brain2D around the 3D scene, he may have these components but they aren't actually being used. He doesn't fall through the floor because his Ignore gravity? field is checked - not because of any collision with the floor.

    AC is quite flexible when it comes to what physics components a character needs. Strictly speaking, a character doesn't need them in order to move - though without them, they won't react to collisions or be able to move up/down slopes etc. You can also replace the Rigidbody/Collider pair with a Character Controller if desired - it really comes down to the needs of your situation.

    If you're having movement and animation issues with your actual player, please share more details and screenshots so that we can see the problem, as well as your AC/Unity version numbers. One thing to note is that, 2D or 3D, your sprite-based character will need to have their "Sprite child" assigned in the Player component.

  • Thank you kindly for the detailed reply. It is helpful. I'll revisit this if after creating a character from scratch if any issues arise.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.