# Collision settings are not consistent (and crash!)

**URL:** <https://forums.unrealengine.com/t/collision-settings-are-not-consistent-and-crash/371193>\
**Category:** World Creation\
**Tags:** unreal-engine, crash, Collision, question\
**Created:** [September 21, 2016, 7:51pm UTC](https://forums.unrealengine.com/t/collision-settings-are-not-consistent-and-crash/371193 "2016-09-21T19:51:46Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![gedamial](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gedamial](https://forums.unrealengine.com/u/gedamial)\
**Post date:** [September 21, 2016, 7:51pm UTC](https://forums.unrealengine.com/t/collision-settings-are-not-consistent-and-crash/371193/1 "2016-09-21T19:51:46Z")

</div>

I have a Projectile C++ class.  
I made a Blueprint class deriving from it in order to make my Rocket actor.

**FIRST PROBLEM (StaticMesh)**

The Rocket has a StaticMesh component and a SphereCollision component. The latter is supposed to detect collision with a Player

![108008-crocket2.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/d/c/9dc429d0f9ae850937b012086ce9d869fb069bc2.jpeg)

I wanted my StaticMesh not to collide with any player (thus, Pawn) inside the World, so I set the StaticMesh collision settings to this:

![108009-crocket.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/b/9/bb95c1de81bbd0da148f4a274902f42e5c3b67cc.jpeg)

_Note the Pawn that is set to be Ignored_

When I put the Blueprint inside the World, these options work.  
When I fire my Rocket through the Weapon, **they don’t! The StaticMesh still blocks my Player!**

One can say that the problem lies right in the fact that I’m spawning something through C++ code… BUT it shouldn’t change my collision settings!

This is the code I use to spawn a projectile

```
FTransform SpawnTM(MyOwner->GetMesh()->GetSocketLocation((FName("WeaponSocket"))));	

	AProjectile* Projectile = Cast<AProjectile>(UGameplayStatics::BeginDeferredActorSpawnFromClass(this, ProjectileClass, SpawnTM));
	
	if (Projectile)
	{		

		Projectile->Instigator = Instigator;
		Projectile->SetOwner(this);
		Projectile->InitVelocity(ShootDir);

		UGameplayStatics::FinishSpawningActor(Projectile, SpawnTM);
	}

```

**SECOND PROBLEM (SphereCollision + Event)**

My Projectile class has a **OnProjectileStop** delegate, which is called whenever the ShereCollision component is blocked by someone

It works fine when I shoot the Rocket through the weapon.  
But when I put the Blueprint of the Rocket inside the World and run towards the SphereCollision, the Engine crashes with a fatal error!

Log file of the crash: [link text][3]

---

<div class="post-metadata">

**Author:** ![Sean\_Flint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Flint](https://forums.unrealengine.com/u/Sean_Flint)\
**Post date:** [September 21, 2016, 8:04pm UTC](https://forums.unrealengine.com/t/collision-settings-are-not-consistent-and-crash/371193/2 "2016-09-21T20:04:42Z")

</div>

Hey gedamial,

When you’re spawning your projectile, are you spawning the base C++ class or are you ensuring to spawn a reference to your blueprint? The changes in collision that you’ve made are only relevant to the blueprint class and if you are spawning the C++ class, those changes won’t be carried over.

---

<div class="post-metadata">

**Author:** ![gedamial](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gedamial](https://forums.unrealengine.com/u/gedamial)\
**Post date:** [September 21, 2016, 8:30pm UTC](https://forums.unrealengine.com/t/collision-settings-are-not-consistent-and-crash/371193/3 "2016-09-21T20:30:32Z")

</div>

> When you’re spawning your projectile, are you spawning the base C++ class or are you ensuring to spawn a reference to your blueprint?

The Weapon (rocket launcher) is responsible for the spawn of the associated projectile (in this case, a rocket).

**Weapon** is another C++ class which holds a variable of type **TSubclassOf**

This variable holds a class.  
This variable is set through the Editor.

Since my Rocket is a Blueprint Class (which derives from AProjectile c++ class) I can easily set that variable to my Rocket Blueprint Class.

So… in short… yes, I’m referring to the Blueprint Class

---

<div class="post-metadata">

**Author:** ![CrimsonHawk](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CrimsonHawk](https://forums.unrealengine.com/u/CrimsonHawk)\
**Post date:** [September 23, 2016, 2:12pm UTC](https://forums.unrealengine.com/t/collision-settings-are-not-consistent-and-crash/371193/4 "2016-09-23T14:12:39Z")

</div>

I would try to make a new Object Collision Channel for the Rockets, and set that this channel is Ignored on Default. This way the Pawn will also ignore your rocket and vice versa.

---

<div class="post-metadata">

**Author:** ![Night\_Watcher](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/night_watcher/32/1145400_2.png) [@Night\_Watcher](https://forums.unrealengine.com/u/Night_Watcher)\
**Post date:** [September 23, 2016, 2:20pm UTC](https://forums.unrealengine.com/t/collision-settings-are-not-consistent-and-crash/371193/5 "2016-09-23T14:20:24Z")

</div>

You are changing the settings of the collision sphere of the projectile, but you forgot about the collision of the rocket mesh itself (which you can disable completely

---

<div class="post-metadata">

**Author:** ![CrimsonHawk](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CrimsonHawk](https://forums.unrealengine.com/u/CrimsonHawk)\
**Post date:** [September 23, 2016, 2:23pm UTC](https://forums.unrealengine.com/t/collision-settings-are-not-consistent-and-crash/371193/6 "2016-09-23T14:23:32Z")

</div>

He said that he changed the StaticMesh which is the body of the rocket. The sphere is there just for overlap detection.

---

<div class="post-metadata">

**Author:** ![CrimsonHawk](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CrimsonHawk](https://forums.unrealengine.com/u/CrimsonHawk)\
**Post date:** [September 23, 2016, 2:25pm UTC](https://forums.unrealengine.com/t/collision-settings-are-not-consistent-and-crash/371193/7 "2016-09-23T14:25:57Z")

</div>

Or you could give your rocket a Projectile Movement component, or set CCD (Continuous Collision Detection) to true and just let the rocket collide with the player.

---

<div class="post-metadata">

**Author:** ![Night\_Watcher](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/night_watcher/32/1145400_2.png) [@Night\_Watcher](https://forums.unrealengine.com/u/Night_Watcher)\
**Post date:** [September 23, 2016, 2:41pm UTC](https://forums.unrealengine.com/t/collision-settings-are-not-consistent-and-crash/371193/8 "2016-09-23T14:41:23Z")

</div>

You are right, sry missed that, but still he doesn’t need any collision on the mesh since it’s going to be destroyed on impact, so why turn it off completely?  
And on sphere collision overlapr, he can cast the overlaping object to check if it’s a pawn or not

---

<div class="post-metadata">

**Author:** ![CrimsonHawk](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CrimsonHawk](https://forums.unrealengine.com/u/CrimsonHawk)\
**Post date:** [September 23, 2016, 4:41pm UTC](https://forums.unrealengine.com/t/collision-settings-are-not-consistent-and-crash/371193/9 "2016-09-23T16:41:13Z")

</div>

But it also have to explode if it hits a wall, or something else. Then why not use only the Static Mesh for hit detection and check what it is? Well, I’d think that if the players run forward and shoots at the same time, it could easily “backfire”. Or the rocket comes out from the character mesh itself.

---

<div class="post-metadata">

**Author:** ![Night\_Watcher](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/night_watcher/32/1145400_2.png) [@Night\_Watcher](https://forums.unrealengine.com/u/Night_Watcher)\
**Post date:** [September 23, 2016, 4:44pm UTC](https://forums.unrealengine.com/t/collision-settings-are-not-consistent-and-crash/371193/10 "2016-09-23T16:44:22Z")

</div>

No, like I said on overlap, cast the overlapped object to pawn, if it is not a pawn then explore. However if you only want to ignore the player, that’s easy, just add to your projectile construction script “Ignore Instigator”, and don’t forget to connect the player “Self” Node to the Spawn Projectile node

---

<div class="post-metadata">

**Author:** ![gedamial](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gedamial](https://forums.unrealengine.com/u/gedamial)\
**Post date:** [September 23, 2016, 7:24pm UTC](https://forums.unrealengine.com/t/collision-settings-are-not-consistent-and-crash/371193/11 "2016-09-23T19:24:44Z")

</div>

The Rocket’s StaticMesh must be set to Ignore all the Pawns in the game (and that’s what I did, but it doesn’t work!)

---

<div class="post-metadata">

**Author:** ![Night\_Watcher](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/night_watcher/32/1145400_2.png) [@Night\_Watcher](https://forums.unrealengine.com/u/Night_Watcher)\
**Post date:** [September 23, 2016, 7:28pm UTC](https://forums.unrealengine.com/t/collision-settings-are-not-consistent-and-crash/371193/12 "2016-09-23T19:28:03Z")

</div>

I once had a strange bug where if the mesh was the main component was a scene root component the projectile would not work. You can try to have The mesh as the main component. Or maybe it was the other way around (make the main component a scene root component). Just try it, it may or may not work

---

<div class="post-metadata">

**Author:** ![Sean\_Flint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Flint](https://forums.unrealengine.com/u/Sean_Flint)\
**Post date:** [September 27, 2016, 2:47pm UTC](https://forums.unrealengine.com/t/collision-settings-are-not-consistent-and-crash/371193/13 "2016-09-27T14:47:45Z")

</div>

What does your Rocket blueprint’s component tree look like? Could you provide a screenshot of that please?

---

<div class="post-metadata">

**Author:** ![gedamial](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gedamial](https://forums.unrealengine.com/u/gedamial)\
**Post date:** [September 27, 2016, 6:45pm UTC](https://forums.unrealengine.com/t/collision-settings-are-not-consistent-and-crash/371193/14 "2016-09-27T18:45:42Z")

</div>

![alt text][1]

---

<div class="post-metadata">

**Author:** ![Sean\_Flint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Flint](https://forums.unrealengine.com/u/Sean_Flint)\
**Post date:** [September 27, 2016, 6:49pm UTC](https://forums.unrealengine.com/t/collision-settings-are-not-consistent-and-crash/371193/15 "2016-09-27T18:49:59Z")

</div>

Thanks a lot. Those settings look solid to me. One more question: if your static mesh is set to ignore your pawn, is your pawn also set to ignore the static mesh component of the rocket, which is currently set to WorldDynamic based on your screenshot provided earlier in the thread?

I’d recommend creating a separate object channel as well for the Rocket static mesh if possible.

---

<div class="post-metadata">

**Author:** ![CrimsonHawk](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CrimsonHawk](https://forums.unrealengine.com/u/CrimsonHawk)\
**Post date:** [September 27, 2016, 6:51pm UTC](https://forums.unrealengine.com/t/collision-settings-are-not-consistent-and-crash/371193/16 "2016-09-27T18:51:04Z")

</div>

It doesn’t ignore pawn now. It’s that intentional?

---

<div class="post-metadata">

**Author:** ![CrimsonHawk](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CrimsonHawk](https://forums.unrealengine.com/u/CrimsonHawk)\
**Post date:** [September 27, 2016, 6:57pm UTC](https://forums.unrealengine.com/t/collision-settings-are-not-consistent-and-crash/371193/17 "2016-09-27T18:57:25Z")

</div>

Glad to hear that I gave a staff approved advice 😃

---

<div class="post-metadata">

**Author:** ![gedamial](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gedamial](https://forums.unrealengine.com/u/gedamial)\
**Post date:** [September 27, 2016, 8:02pm UTC](https://forums.unrealengine.com/t/collision-settings-are-not-consistent-and-crash/371193/18 "2016-09-27T20:02:40Z")

</div>

Hi.

I created a new Object Channel (default response: ignore) and applied that to my Rocket Static Mesh

And this is the Pawn Capsule Collision setting

 ![108692-we2.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/f/1/1f171346feedf94bfa70b45055c36195124a8ff7.jpeg)

As you can see, both ignore each other… but it doesn’t work :c

---

<div class="post-metadata">

**Author:** ![CrimsonHawk](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CrimsonHawk](https://forums.unrealengine.com/u/CrimsonHawk)\
**Post date:** [September 27, 2016, 9:26pm UTC](https://forums.unrealengine.com/t/collision-settings-are-not-consistent-and-crash/371193/19 "2016-09-27T21:26:26Z")

</div>

But the CollisionComp still Blocks the Pawn channel, doesn’t it?

---

<div class="post-metadata">

**Author:** ![gedamial](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gedamial](https://forums.unrealengine.com/u/gedamial)\
**Post date:** [September 28, 2016, 10:56am UTC](https://forums.unrealengine.com/t/collision-settings-are-not-consistent-and-crash/371193/20 "2016-09-28T10:56:52Z")

</div>

The Collision Component of the Rocket MUST block the Pawn (for hit detection). It’s the StaticMesh that MUST NOT block the Pawn.

[Next page](https://forums.unrealengine.com/t/collision-settings-are-not-consistent-and-crash/371193.md?page=2)
