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"

Why does a c++ generated static mesh not block my collision channel?


I am using a trace to detect an actor on the floor, the trace and collision channel both work fine on an ordinary static mesh added to the actor in engine. However when I replace this mesh with a static mesh component created in c++, the trace fails to be blocked even though the collision settings are identical.

Product Version: Not Selected
more ▼

asked Oct 09 '14 at 04:59 PM in C++ Programming

avatar image

Alacrity 11
6 1 1 1

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

1 answer: sort voted first

I've found a few issues with C++ generated objects and collision. Particularly I've found that attaching and detaching components will sometimes blow away all of your custom collision and physics settings.

My solution was to set all of my collision channels again after attaching or detaching components. Even if you aren't attaching/detaching components, are you sure you set all the channels correctly in code? It looks something like this where CollisionComp is a primitive component:

 // Set up the collision channels
 CollisionComp->SetCollisionResponseToChannel(COLLISION_PLAYERMOVEMENT, ECollisionResponse::ECR_Ignore);
 CollisionComp->SetCollisionResponseToChannel(COLLISION_TETHERBALL, ECollisionResponse::ECR_Ignore);
 CollisionComp->SetCollisionResponseToChannel(COLLISION_PLAYERPAWN, ECollisionResponse::ECR_Ignore);
 CollisionComp->BodyInstance.SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics, true);

As a reference, my custom collision types are:

 #define    COLLISION_PLAYERMOVEMENT    ECollisionChannel::ECC_GameTraceChannel1
 #define    COLLISION_TETHERBALL        ECollisionChannel::ECC_GameTraceChannel2
 #define    COLLISION_PLAYERPAWN        ECollisionChannel::ECC_GameTraceChannel3
more ▼

answered Nov 11 '14 at 04:21 AM

avatar image

593 28 51 118

avatar image ttvd Nov 11 '14 at 04:33 AM

I have a similar problem. I also found I need to manually recreate physics state when I attach component to the other. Otherwise no collisions are processed for that attached component.

(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