# Proper Collision/Physics Settings for Skeletal Mesh, and Physics Asset

**URL:** <https://forums.unrealengine.com/t/proper-collision-physics-settings-for-skeletal-mesh-and-physics-asset/45525>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [October 23, 2015, 3:11pm UTC](https://forums.unrealengine.com/t/proper-collision-physics-settings-for-skeletal-mesh-and-physics-asset/45525 "2015-10-23T15:11:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jerry.Richards](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jerry.Richards](https://forums.unrealengine.com/u/Jerry.Richards)\
**Post date:** [October 23, 2015, 3:11pm UTC](https://forums.unrealengine.com/t/proper-collision-physics-settings-for-skeletal-mesh-and-physics-asset/45525/1 "2015-10-23T15:11:36Z")

</div>

I’m having some trouble getting collision events to trigger for a mechanical actor I have in my scene that uses a skeletal mesh, and physics asset. My projectile passes right through them without getting the OnHit event.

Can someone please explain to me what are the proper settings for the Skeletal Mesh:

```auto

Physics:
Enable Per Poly Collision YES
Physics Asset MyActor_Physics

```

Settings for MyActor\_Physics:

```auto

root bone
   Physics
      Mass in Kg YES
      Mass 100
      Enable Gravity NO
      Physics Type Default

   Collision
      Simulation Generates Hit Events YES
      Collision Response ENABLED

bone2
    <same as above>
bone3
    <same as above>

```

Then I apply Asset → Apply PhysMat

In my BP class that inherits my APawn code, I set the following:

```auto

DefaultSceneRoot
   Physics
      Should Update Physics Volume NO

SkeletalMesh
   Physics
      Simulate Physics YES
      Enable Gravity NO
      Constraints NONE
      Start Awake YES
      Physics Asset Override NONE
      Should Update Physics Volume NO

   Collision
      Simulation Generates Hit Events YES
      Generate Overlap Events YES
      Collision Presets BlockAll

```

Is there something else I’m missing?

Thank you in advance for your help.

---

<div class="post-metadata">

**Author:** ![Pumpy\_Bird](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pumpy\_Bird](https://forums.unrealengine.com/u/Pumpy_Bird)\
**Post date:** [October 23, 2015, 3:41pm UTC](https://forums.unrealengine.com/t/proper-collision-physics-settings-for-skeletal-mesh-and-physics-asset/45525/2 "2015-10-23T15:41:19Z")

</div>

Make sure the projectile also had collision generated events enabled? I think it’s hard to say without knowing how the projectile is configured.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_33e74471](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_33e74471](https://forums.unrealengine.com/u/anonymous_user_33e74471)\
**Post date:** [October 23, 2015, 3:56pm UTC](https://forums.unrealengine.com/t/proper-collision-physics-settings-for-skeletal-mesh-and-physics-asset/45525/3 "2015-10-23T15:56:47Z")

</div>

How fast is your projectile going? Do you have CCD on? If it’s going too fast it might be tunneling through your player.

---

<div class="post-metadata">

**Author:** ![Jerry.Richards](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jerry.Richards](https://forums.unrealengine.com/u/Jerry.Richards)\
**Post date:** [October 23, 2015, 4:35pm UTC](https://forums.unrealengine.com/t/proper-collision-physics-settings-for-skeletal-mesh-and-physics-asset/45525/4 "2015-10-23T16:35:11Z")

</div>

Thank you Pumpy Bird. I should have included that too.

The projectile is a static mesh and I can break in Visual Studio debugger on the OnHit event, which shows that I am hitting other parts of the scene but not my actor.

Static Mesh settings are:

```auto

Import Settings
   Auto Generate Collision YES

Collision
   Customized Collision NO

```

---

<div class="post-metadata">

**Author:** ![Jerry.Richards](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jerry.Richards](https://forums.unrealengine.com/u/Jerry.Richards)\
**Post date:** [October 23, 2015, 4:46pm UTC](https://forums.unrealengine.com/t/proper-collision-physics-settings-for-skeletal-mesh-and-physics-asset/45525/5 "2015-10-23T16:46:24Z")

</div>

mrooney, I suspect the projectile may be going a little fast, and I can certainly turn on CCD. Is that for the projectile itself?

Forgive me, but I’m mid stream in making changes to my code. Previously I followed along with this walkthrough:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...

taking parts that were related to me. One area I wanted to get away from is the inclusion and construction of the collision component. Is that possible?

```auto

.h
    UPROPERTY(VisibleDefaultsOnly, Category=Projectile)
    USphereComponent* CollisionComp;

.cpp
        CollisionComp = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(this, TEXT("SphereComp"));
        CollisionComp->InitSphereRadius(15.0f);
        RootComponent = CollisionComp;

```

Is it possible to assign the collision component in the BP editor, and search for it in code? I’m looking for a way to add my own event handler to the collision component without being tied to a specific type of collision component:

```auto

        CollisionComp->OnComponentHit.AddDynamic(this, &AMyProjectile::OnHit);

```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_33e74471](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_33e74471](https://forums.unrealengine.com/u/anonymous_user_33e74471)\
**Post date:** [October 23, 2015, 5:52pm UTC](https://forums.unrealengine.com/t/proper-collision-physics-settings-for-skeletal-mesh-and-physics-asset/45525/6 "2015-10-23T17:52:20Z")

</div>

I’ve never actually made a component in code, opting mostly for blueprints, but I can tell that your collision component doesn’t seem to have a collision profile, which could make it not want to collide with anything.

Personally I’d make it in blueprint just because it’s so much easier to make sure all the right checkboxes are ticked. You can definitely bind your C++ callback to the OnComponent hit in BP. Just make your OnHit function blueprint callable and then use the On Component Hit Function on the collision component to call your function.
