# Actor class crashes the editor on Play

**URL:** <https://forums.unrealengine.com/t/actor-class-crashes-the-editor-on-play/490379>\
**Category:** C++\
**Tags:** crash-on-play, unreal-engine, CPP, question, actor-class\
**Created:** [October 29, 2021, 2:24am UTC](https://forums.unrealengine.com/t/actor-class-crashes-the-editor-on-play/490379 "2021-10-29T02:24:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmancoder1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jmancoder1](https://forums.unrealengine.com/u/jmancoder1)\
**Post date:** [October 29, 2021, 2:24am UTC](https://forums.unrealengine.com/t/actor-class-crashes-the-editor-on-play/490379/1 "2021-10-29T02:24:03Z")

</div>

Whenever I play a scene with this C++ class, the editor crashes. I have found no errors in my code, yet it still crashes with an “EXCEPTION\_ACCESS\_VIOLATION”. Could someone please explain why this is occurring? Here is the code:

```
#include "VoxelChunk.h"

AVoxelChunk::AVoxelChunk()
{
	PrimaryActorTick.bCanEverTick = true;
}

void AVoxelChunk::BeginPlay()
{
    Super::BeginPlay();

    for (auto x = 0; x < 15; x++)
    {
        for (auto y = 0; y < 15; y++)
        {
            for (auto z = 0; z < 15; z++)
            {
                chunk[x][y][z] = 1;
            }
        }
    }

    // Print contents of chunk array
    for (int i = 0; i < sizeof(chunk); i++)
    {
        GEngine->AddOnScreenDebugMessage(-1, 15.0f, 
            FColor::Yellow, FString::Printf(TEXT("%lld"), chunk[i]));
    }
}

```

---

<div class="post-metadata">

**Author:** ![jmancoder1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jmancoder1](https://forums.unrealengine.com/u/jmancoder1)\
**Post date:** [October 29, 2021, 7:21pm UTC](https://forums.unrealengine.com/t/actor-class-crashes-the-editor-on-play/490379/2 "2021-10-29T19:21:14Z")

</div>

Well, after creating a new project, it no longer crashes. I guess my visual studio project was corrupt.
