Announcement

Collapse
No announcement yet.

Combining Colliders

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Combining Colliders

    Hey Guys,

    I have a character with more than one collider. This is causing me serios pain because, as most of you know, Unreal lets you only handle one collider per character.
    The character movement component is perfect for moving my main chatacter , so I dont want to write a new movement component from scratch. I was thinking to add a new collider with a phyisc constrain to my character and whenever the hit event of the second collider is triggered then trigger the hitevent of the first collider. Any one any ideas how to achieve that or any other suggestions? I would just need the second collider to avoid parts of my character running into walls.

    Thanks Pascal

    #2
    Originally posted by meiwen View Post
    I have a character with more than one collider. This is causing me serios pain because, as most of you know, Unreal lets you only handle one collider per character.
    I'm not sure what you're referring to. You can have multiple "colliders" by handling collisions on a component level.

    Unless you're specifically referring to character movement, which does assume a single capsule. If you character is encroaching into walls, then increase the radius of the agent. A second collision shape should not be necessary.

    -Camille

    Comment


      #3
      Hi Camille,

      thank you for the answer, but unfortunatly our charcater doesnt really fit into the size of the capsule, so there will be always parts looking outside of the capsule. So scaling up the collider would end in a massive collider blocking a lot of dead air

      Comment


        #4
        Usually with characters you want the collision to be as simple as possible. It's usually OK to have a character either have too small a capsule and occasionally have their mesh clip through walls, or be too large a capsule with dead air.

        Players probably won't notice. I was playing Resident Evil 4 yesterday, and randomly noticed actually and it didn't even bother me. I only noticed because I was paying attention as a game developer.

        Is your character special in some way where the capsule just doesn't work?

        Comment


          #5
          hey,

          yes indeed, the character is a wolf, so his bodyshape is more of a horizontal capsule. If I use a smaller one his whole frontbody moves into walls or other objects.

          Comment


            #6
            Hey meiwen, any update on this? Did you end up just making a really short, long capsule?

            Comment


              #7
              Originally posted by meiwen View Post
              hey,

              yes indeed, the character is a wolf, so his bodyshape is more of a horizontal capsule. If I use a smaller one his whole frontbody moves into walls or other objects.
              The Solution for that problem is to make a pawn and turn your mesh 90 degress up on scene turn the pawn 90 degreee back.

              For that to work you have to write a custom movement component if its ai controlled or just write your pawn class so that your forward axis is Z.
              Thats actually relatively easy to do. just make a custom c++ class inherented from pawn and follow the ue4 tutorial https://docs.unrealengine.com/latest...put/index.html
              follow that and then jsut change the influenced axis from forward to up. (y to z).
              or as a further twist add impuls instead of kinematic movement.

              Beware you cant use the c++ class directly you have to make a Bp out of that again so you can drag this onto the scene! Its also not a bad idea to not set the camera and spring arm up in the class but later on in the BP.

              I didnt try this with Bps but with cpp its no problem. The next problem which inherents from that is the camera control sceme which gets a little messed up if you intend to inherent control rotation for the springarm. That may require a custom getViewrotation method in your pawn class. Otherwiese its just a bit of mind twisting trial and error to make that look good.

              But Beware a Capsule that s not always upright has problem with friction and behaving properly when controlled paritally by physics. By that i mean its likely to tople if not restrict on pitch. And roll you have to restrict anyway because you will never get the roll to behave. Pitch is a matter of taste and with less friction it isnt so likely to toplle over the front or back end. But you can make fun things with its just a little bit like the vehicle vontroller from physx which also rewquires a lot of time to get right. You will see what im talking about when yu try this out ;D


              And dont try to inherent from actor because actor is not controllable because UWorld coesent know about it. Thats only doable(AFAIK) when editing the source code and would require therefore to have that on mind with every change to the engine. Using Character as base class for this is also not a viable solution AFAIK. So this is the least painful way of doing this.


              Its really sad that UE is so restricted when its comes to character collision setups.
              Last edited by Smash; 04-02-2016, 07:07 PM.

              Comment

              Working...
              X