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"

FBodyInstance::SetObjectType doesn't work

I was finding a way to change collision channels of rigid bodies on the fly and found a function called FBodyInstance::SetObjectType that looked like the one. I tried but it didn't work.

Here's how I did the test: I created a project of the ThirdPerson template and added a Box Collision component to the player character and set the collision channel of the box to Vehicle and made it overlap only PhysicsBody. Then I created another character with PhysicsAsset and set up the collision data of the character mesh that it overlaped Vehicle and its collision channel was PhysicsBody. And then I wired up a PrintText node in the box' graph for OnComponentBeginOverlap event so that whenever the box touched the character with PhysicsAsset I would got on-screen messages.

Once I made sure the setup worked, I started the real test: I changed the collision channel of the character mesh with PhysicsAsset to Pawn and called GetMesh()->SetAllBodiesCollisionObjectType(ECC_PhysicsBody) in BeginPlay() function on the character with PhysicsAsset since internally it calls FBodyInstance::SetObjectType. However, the overlap event wasn't triggerd and I didn't get any messages as the previous test. So I don't think FBodyInstance::SetObjectType really works. I hope I am wrong and someone can share how to use this function properly.

Product Version: UE 4.14
Tags:
more ▼

asked Dec 09 '16 at 02:26 PM in C++ Programming

avatar image

Isatin
85 5 7 126

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

0 answers: sort voted first
Be the first one to answer this question
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