# C++ actor collision not in level

**URL:** <https://forums.unrealengine.com/t/c-actor-collision-not-in-level/471117>\
**Category:** Character & Animation\
**Tags:** spawn-actor, unreal-engine, Physics, Collision, Scripting, question\
**Created:** [September 14, 2020, 6:27am UTC](https://forums.unrealengine.com/t/c-actor-collision-not-in-level/471117 "2020-09-14T06:27:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_311c2dae](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_311c2dae](https://forums.unrealengine.com/u/anonymous_user_311c2dae)\
**Post date:** [September 14, 2020, 6:27am UTC](https://forums.unrealengine.com/t/c-actor-collision-not-in-level/471117/1 "2020-09-14T06:27:40Z")

</div>

I have a paper character that I created in C++. I added a box collision to the actor in the constructor. Then I created a blueprint based on this C++ class. In the blueprint viewport I can see the collision box and it is listed as inherited. When I spawn the blueprint into my level and show collisions, the box that I added is not shown. I CAN see the capsule collision that was inherited from character in my level, so why does my box collision not spawn in the level.

relevant paper character code:

```
Aoverworld_player_char_c::Aoverworld_player_char_c()
{
	// configure collisions
	top_collision = CreateDefaultSubobject<UBoxComponent>(top_collision_name);
	top_collision->SetRelativeLocation(top_collision_loc);
	top_collision->SetRelativeRotation(top_collision_rot);
	top_collision->SetRelativeScale3D(collision_scale);

	// configure begin overlap callbacks
	top_collision->OnComponentBeginOverlap.AddDynamic(this, &Aoverworld_player_char_c::boxBeginOverlap);

	// configure end overlap callbacks
	top_collision->OnComponentEndOverlap.AddDynamic(this, &Aoverworld_player_char_c::boxEndOverlap);
}

void Aoverworld_player_char_c::boxEndOverlap(UPrimitiveComponent* overlapped, AActor* actor, UPrimitiveComponent* other_comp,
	int32 other_body_index)
{
	UBoxComponent* collision = Cast<UBoxComponent>(overlapped);
	if (collision != nullptr)
	{
		Edirection dir = Edirection::UNKNOWN;
		FString name = collision->GetName();
		if (name == top_collision_name.ToString())
			dir = Edirection::UP;
		
		if (dir != Edirection::UNKNOWN)
			processCollisionEnd(dir, actor);
	}
}

void Aoverworld_player_char_c::boxBeginOverlap(UPrimitiveComponent* overlapped, AActor* actor, UPrimitiveComponent* other_comp,
	int32 other_body_index, bool from_sweep, const FHitResult& sweep_result)
{
	UBoxComponent* collision = Cast<UBoxComponent>(overlapped);
	if (collision != nullptr)
	{
		Edirection dir = Edirection::UNKNOWN;
		FString name = collision->GetName();
		if (name == top_collision_name.ToString())
			dir = Edirection::UP;
		
		if (dir != Edirection::UNKNOWN)
			processCollisionStart(dir, actor);
	}
}

```

here is the viewport, you can see the (small) capsule in the center of the sprite and can see the 4 collision boxes

 ![313099-viewport.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/5/f/25f64cf5c9e257002dc81e53ec1a73258c9d6abe.png)

here is the level during play with collision showing. You can only see the capsule

![313098-capture2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/6/a/d6addd1dffb31a9fcbc291f5a330f819340aa80e.png)
