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"

Set Character Collision to Mesh

Hi, I have taken a copy of the MyCharacterBP and I am modifying it for my game. The Blueprint uses a Capsule for collisions. Is there a way i can use my characters body for collision (to make the mesh itself interact with the world geometry and other objects), or at least change the Collision Capsule to some other shape (like a box or a capsule that is not the same length and width)?

Product Version: Not Selected
Tags:
more ▼

asked Jan 31 '15 at 02:28 PM in Blueprint Scripting

avatar image

UDKAP
454 29 42 62

avatar image Moss Feb 26 '15 at 10:22 PM

Are you still having issues? If not just resolve the answer ^^

Cheers, Moss

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

If you are using the CharacterBlueprint of the examples you have to stick with the capsule for now, the reason is that the CharacterMovementComponents requires it. From that you have to options, create a totally new new movement components or play around with the height and width of the capsule. Using the whole mesh for all collisions is a bad idea because it will cost a lot but the mesh is actually used for traces such as bullets to be precise.

If you still want to go the route to create you own movement component you have to create a new Character in C++ that changes the default movement component set by ACharacter. You can do that using your characters constructor:

 AMyNewCharacter::AMyNewCharacter(const FObjectInitializer& ObjectInitializer)
     : Super(ObjectInitializer.SetDefaultSubobjectClass<UMyNewMovementComponent>(ACharacter::CharacterMovementComponentName)) 
 {
     // Your Character Movement Component is now using your own class.
 }

To be able to achieve your goals you should look at the implementation of UPawnMovementComponent and UCharacterMovementComponent.

more ▼

answered Jan 31 '15 at 04:49 PM

avatar image

Moss
6.4k 127 98 606

avatar image UDKAP Jan 31 '15 at 06:22 PM

Can I at least change the capsule to be a square Volume somehow?

avatar image Moss Jan 31 '15 at 06:38 PM

If you set the radius and the half-height to be the same you will have a sphere.

avatar image UDKAP Feb 01 '15 at 08:59 AM

Is there a way i can add another Component and use its collision instead of the one of the root component?

avatar image Moss Feb 01 '15 at 11:14 AM

Yes you can, not as the main collision component though but it will work. Just add a new BoxComponent to your BluePrint, and set the collisions to BlockAllDynamic.

avatar image UDKAP Feb 01 '15 at 04:52 PM

That didn't work, i even tried Block all

avatar image UDKAP Feb 02 '15 at 11:29 AM

I converted the geometry to meshes, now it works, thanks a lot. :)

avatar image Moss Feb 02 '15 at 11:32 AM

Nice! Remember to accept the answer to help others ^^

avatar image Shiyulin Mar 25 '15 at 03:02 PM

Hi I am also trying to customize the collision of characters. Could you explain more of "converted the geometry to meshes"? not quite sure what is means. thanks!

avatar image Moss Mar 25 '15 at 03:10 PM

Please open a new question for it to help others with the same issues: https://answers.unrealengine.com/questions/ask.html

avatar image moody.by.name Jun 19 '16 at 12:09 PM

If the answer relies on someone saying "I converted the geometry to meshes, now it works, thanks a lot. :)" and the other saying "Nice! Remember to accept the answer to help others ^^" then surely asking "Could you explain more of "converted the geometry to meshes"? not quite sure what is means. thanks!" - is still related to this question. I also want to know what they meant, because I don't know what the crucial bit of the answer means. Why new question, when the answer is not sufficient for at least 2 people, probably more...

avatar image moody.by.name Jun 19 '16 at 12:11 PM

When I google "UE4 converted the geometry to meshes" it is nothing related to this question - the requirement is specific to this question, so posing a new question based on this would involve explaining the whole context of the original question here...

avatar image Benni.Lodge Jan 09 '17 at 12:17 PM

I agree, this isn't a very well answered question.

avatar image knziha Nov 08 '18 at 12:12 PM

lies.adding additional collision components won't effect character movement.right?

(comments are locked)
10|2000 characters needed characters left

What I would recommend is that you change the collision type of your capsule. then you can ignore that type with other objects.

For example, I set my capsules to Pawn and my character meshes to Skeleton Now I ignore Pawn collisions with the mesh which is set to Skeleton.

The effect for me is that I use the capsule collision for some things but not for character interactions.

more ▼

answered Jan 10 '17 at 12:15 AM

avatar image

learningOver
154 3 3 9

avatar image AJ_Graphix Jan 10 '17 at 01:39 AM

Thank you learningOver for taking the time to share your insights. So for a character that has a head that protrudes outside of the default capsule, how would you have to set up collision for a box collision component that you add to the head, so it actually stops the character when they bump into a wall? Currently, only the default capsule will stop the character from penetrating, the extra collision component does nothing.

Thanks!

avatar image Moss Jan 10 '17 at 07:12 AM

Thats the main issue, if you use the default CharacterMovementComponent you are forced to use a capsule. Even if you ignore pawns for it it will sfill be used for movement collisions with the world (plus network predictions etc.). So what you can do is to write your own movement component that handles something different than a capsules.

avatar image AJ_Graphix Jan 10 '17 at 09:04 PM

Thank you, Moss, for your helpful reply. Currently writing my own movement component would be outside the scope of my skill set, but perhaps eventually I would be able to achieve this. For now, I'm just using a resized capsule component that tries to best approximate my mesh.

Have a good day.

~Adam

avatar image kShadowcraft Jan 11 '18 at 09:50 AM

Hey guys, any update on the set character collision to mesh thingy?

(comments are locked)
10|2000 characters needed characters left
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