x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How can I properly set up character collision for prone?

Hello all,

I'm currently trying to set up a third person character to be able to use prone, and I'm using the Character class, not a standard pawn. (I'm working inside of the Generic Shooter template, FYI)

I'm finding that it is next to impossible to manually set the standard character capsule to a custom size to account for a character in prone, so that the legs and upper body don't glitch through objects. I've seen this exact question/request posted many times already by others, for over two years now and have YET to see a valid option.

I've attempted to flip the character 90 degrees, but that starts to con-volute my movement and aiming setup, and it seems like the wrong way to go.

Currently, I'm trying to add a box collision to the character mesh so that when the capsule collider doesn't do its job, the box will take over(since the box is easily re-sizeable) and prevent glitching through objects. However, the box doesn't seem to be colliding, even with the exact same collision settings as the capsule. I'm not sure if the capsule overrides any other collision meshes attached to the character or not, so if anyone can enlighten me on how I can correct that, or even better yet, point me in the direction of a much more effective way to do this.

I'll be honest, I'm still surprised that it's this difficult to do such a standard movement type prevalent in so many games, even after so many have constantly requested it........hint hint Epic lol.

Thanks for any help provided.

George

alt text

Product Version: UE 4.14
Tags:
more ▼

asked Apr 23 '17 at 03:21 AM in Blueprint Scripting

avatar image

Geogos999
13 3 5 5

avatar image JakeOliveros Apr 23 '17 at 04:32 AM

Something like this?

boxCollision follows mesh height,width alt text

sample.png (954.7 kB)
avatar image Geogos999 Apr 23 '17 at 05:24 AM

Well, sort of. See, I have a box collider attached, essentially identical to the way you do. What I'm finding as I do more research, however, is that the built-in Character class capsule ALWAYS seems to take priority and discard collision data for anything else attached (with the exception to colliding with specific objects, like guns for example). The mesh will fall through the floor until it hits the Character capsule, regardless of boxes or spheres attached to any joint on the character, with any collision detection setting from what I can tell.

avatar image Geogos999 Apr 23 '17 at 05:37 AM

I'm honestly even open to the possibility of changing the C++ Character class if that makes it work, although I don't know barely any C++, only some Java. I assume it would be possible to swap out the capsule component for a box component, but I'm not sure how to do that just yet.

avatar image Clazzid Jun 15 '19 at 03:03 AM

I have yet to figure out if its possible, but I was thinking of a way to achieve this while using the ACharacter class, you could do all kinds of traces or collision checks if you are using a custom movement component, and custom movement mode, you could override PhysCustom() to somehow limit rotation and movement using custom collision to represent the prone character. something like in this post:

How to implement own movement mode

Although i may be wrong.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Epic Characters are a very specific type of Upright Pawn, with custom fake physics built into its movement component, which makes all kinds of assumptions that an upright cylinder allows, like not worrying about collision during rotations, because its smooth and symmetrical on the vertical axis, and using Z as gravity, instead of an arbitrary gravity direction, or detecting stairs slope angle and step height based on the bottom of the capsule.

if you need prone, you should not be using Character as your base class, its too specific, you should be using Pawn, with a custom movement component. in programming, class inheritance requires that every child class IS A more specific version of a parent class, and includes all functionality of its parent, plus extra functionality. adding prone would not be just an additional feature, it would be a rewrite of the very core of how the character movement component's fake physics works, so it makes more sense to rewrite that starting with a more generic base class, like pawn.

prone crawling with prone blocking and the ability to lay diagonally on stairs, is a more complicated movement type than an upright, radially-symmetric walk/crouch/jump/swim actions, and goes outside the scope of what the Character class was designed for.

it would be easier to take a 4 wheeled vehicle, make the wheels invisible, and replace the car body with a crawling human, because if you imagine being prone on a hill while turning, you will need something similar to those 4 wheels to detect the ground slope and rotate the character out of penetrations.

if you need a playable actor, which is not always an Upright Radially Symmetric Capsule With Z Gravity, you should not use Character, you should use Pawn.

more ▼

answered Apr 23 '17 at 09:18 PM

avatar image

ScottSpadea
9.6k 320 205 450

avatar image Geogos999 Apr 24 '17 at 02:29 AM

Thanks Scott. It puts it into perspective. I had a feeling I would have to use a pawn, but was hoping there was a way to avoid it.

avatar image Vaheva Nov 07 '17 at 05:02 PM

@ScottSpadea I understand all prone system problems and your comparison to vehicle is very good. But I think, in one of most advanced game engine this should be implemented as ready solution, same like a crouch etc. I know, everything developer can do in code, but why everybody should do same things again and again, where it should be in engine just good done? For human body although. As game creator this is much more important for me than new graphic functions – finally this is game engine, not graphic only for archvis? Generally I think here should be stronger pressure on gameplay abilities in engine and better documentation - however, good documentation, community and engine itself are one of main reasons I'm working in Unreal Engine.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question