I have created a C++ with two components: UStaticMeshComponent and UBoxComponent.
APaddle::APaddle()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
MeshComp = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("MeshComp"));
// Set the first object in the hierachy.
RootComponent = MeshComp;
CollisionComponent = CreateDefaultSubobject<UBoxComponent>(TEXT("CollisionComp"));
CollisionComponent->SetupAttachment(MeshComp);
}
I have blueprinting it, and when I place it on the level and edit it and set Shape_Cube to Mesh_Comp I get this:
Thanks for your comment. Now I’m using Cube and there isn’t any offset. Is there anyway to modify Shape_Cube offset? I don’t know how to create static meshes and also, I don’t know how to set up an offset.
if you open the Shape_Cube blueprint and click “Class Defaults” at the top, there should be an entry called Pivot Offset and you could change that
If you want to create a really simple mesh you could use a brush. Just look up some tutorials on “ue4 brushes”. Then after you create the brush, convert it to a static mesh