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"

Change Collison Object Type of a RigidBody on a SkeletalMeshComponent

Hi all,

I set up a PhysicsAsset on a SkeletalMeshComponent on my character, but I would like to change the collision object types of certain rigid bodies on the fly instead of using the collision object type of the mesh component. Is it possible? How it could be done?

Product Version: UE 4.14
more ▼

asked Dec 06 '16 at 03:42 AM in C++ Programming

avatar image

85 5 7 127

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

1 answer: sort voted first

To my knowledge, collision channels and object types are limited to component scope. They cannot be applied further down the hierarchy to individual physics bodies. However, each body in the physics asset has an option to set a physics material (which can be different from the physics material applied to the whole mesh). From what I understood by going through https://docs.unrealengine.com/latest/INT/Engine/Physics/PhysicalMaterials/PhysMatUserGuide/ , these physics material overrides can be accessed through LineTrace (with the TraceComplex bool ON). There is a physics material output in the 'Hit' structure.

It can help you to distinguish between different physics bodies of your physics asset but I don't know how expensive it might be or that if this is something you were looking for. Cheers!

more ▼

answered Dec 06 '16 at 11:02 AM

avatar image

21 3 9

avatar image Isatin Dec 09 '16 at 11:28 AM

Thanks for your reply.

I knew PhysicsMaterials but I need to change Collision Object Types (collision channel) of some rigid bodies on a character ON THE FLY in AnimNotifies to simulate hit boxes in a fighting game but PMs cannot help me for that unless I can change PMs of rigid bodies on the fly as well.

In fact, there is a function called FBodyInstance::SetObjectType that is supposed to be able to change the collision object type of a rigid body, I tried but it didn't work. Maybe I should post another question for that.

(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