How to set up collision for static mesh component C++

I have a class inheriting from AActor…
I would like to add a collision to the static mesh component property I have added to the class. What are the methods to do this?
Any documentation for this?

I currently have this:


       // Instantiate stuff
	StaticMeshComponent = PCIP.CreateDefaultSubobject <UStaticMeshComponent>(this, TEXT("mySubObject"));
	SceneComponent = PCIP.CreateDefaultSubobject<USceneComponent>(this, TEXT("SceneComp"));

        // Set up mesh stuff
	static ConstructorHelpers::FObjectFinder<UStaticMesh> staticMesh(TEXT("StaticMesh'/Engine/EditorMeshes/EditorPlane'"));
	StaticMeshObject = staticMesh.Object;

	// These 2 properties allow the movement arms in the editor to actually position the static mesh
	RootComponent = SceneComponent;
	StaticMeshComponent->AttachTo(RootComponent);

	StaticMeshComponent->SetStaticMesh(StaticMeshObject);


        // What do I need to call on the Static mesh to enable a simple box collision for example?

**Hey Jimmyt1998!
**
There are actually two fairly simple methods of doing this. :smiley:

The one I would suggest, since you are using a specific mesh object from your package, is to open that mesh and add collision while in the editor.

However, if you want to add collision via C++, create a new “UBoxComponent” subobject, parent it to the mesh, and set it’s size.
I believe that by default it is set to “BlockAll” (Not entirely sure though).

Hope this helps!

-