# Why doesn't my USplineMeshComponent have a material?

**URL:** <https://forums.unrealengine.com/t/why-doesnt-my-usplinemeshcomponent-have-a-material/464925>\
**Category:** Rendering\
**Tags:** spline-mesh-componen, unreal-engine, question\
**Created:** [May 9, 2020, 2:39pm UTC](https://forums.unrealengine.com/t/why-doesnt-my-usplinemeshcomponent-have-a-material/464925 "2020-05-09T14:39:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SolitaryTurian](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SolitaryTurian](https://forums.unrealengine.com/u/SolitaryTurian)\
**Post date:** [May 9, 2020, 2:39pm UTC](https://forums.unrealengine.com/t/why-doesnt-my-usplinemeshcomponent-have-a-material/464925/1 "2020-05-09T14:39:45Z")

</div>

I’m playing around with understanding how splines work, and I’m creating a number of `USplineMeshComponents` during runtime. No matter what I do, however, I cannot get my components to show up with the default material for the `StaticMesh` I’m using - they all use the default `WorldGridMaterial`.

If I swap to using a `UStaticMeshComponent` it shows up fine, but I obviously lose the ability to skew the mesh based on the spline’s path, so I can’t use that.

I’ve pasted a simple example below that I think reproduces the problem in 4.24 (I haven’t tested in 4.25 yet). Just drag an instance of the actor into a level and choose any Static Mesh for the `Mesh` property.

Any suggestions as to what I might be missing is greatly appreciated!

**DeleteMeActor.h**

```
#pragma once

#include "CoreMinimal.h"
#include "Components/SplineMeshComponent.h"
#include "Components/StaticMeshComponent.h"
#include "GameFramework/Actor.h"
#include "DeleteMeActor.generated.h"

UCLASS()
class TESTGAME_API ADeleteMeActor : public AActor
{
    GENERATED_BODY()

public:	
    ADeleteMeActor();

protected:
    virtual void BeginPlay() override;

private:
    UPROPERTY(EditAnywhere)
    UStaticMesh* Mesh;
};

```

**DeleteMeActor.cpp**

```
#include "DeleteMeActor.h"

ADeleteMeActor::ADeleteMeActor()
{
    if (!RootComponent)
    {
        RootComponent = CreateDefaultSubobject<USceneComponent>(TEXT("Root"));
    }
}

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

    // UStaticMeshComponent* MeshComponent = NewObject<UStaticMeshComponent>(this);
    USplineMeshComponent* MeshComponent = NewObject<USplineMeshComponent>(this);
    MeshComponent->SetMobility(EComponentMobility::Movable);
    MeshComponent->SetStaticMesh(Mesh);

    MeshComponent->SetCollisionEnabled(ECollisionEnabled::Type::QueryAndPhysics);
    MeshComponent->RegisterComponent();
    MeshComponent->AttachToComponent(
            RootComponent,
            FAttachmentTransformRules::KeepRelativeTransform
    );
}
```

---

<div class="post-metadata">

**Author:** ![SolitaryTurian](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SolitaryTurian](https://forums.unrealengine.com/u/SolitaryTurian)\
**Post date:** [May 9, 2020, 3:07pm UTC](https://forums.unrealengine.com/t/why-doesnt-my-usplinemeshcomponent-have-a-material/464925/2 "2020-05-09T15:07:33Z")

</div>

I found the solution in [https://answers.unrealengine.com/questions/954199/view.html](https://answers.unrealengine.com/questions/954199/view.html). A material has a checkbox in the material editor called “Used with Spline Meshes”, which needs to be checked.

I wish the engine emitted a warning if one tried to use a material for something it’s not meant for.

---

<div class="post-metadata">

**Author:** ![Mumchina](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mumchina](https://forums.unrealengine.com/u/Mumchina)\
**Post date:** [June 28, 2023, 3:49pm UTC](https://forums.unrealengine.com/t/why-doesnt-my-usplinemeshcomponent-have-a-material/464925/3 "2023-06-28T15:49:21Z")

</div>

> [@SolitaryTurian](#):
>
> Used with Spline Meshes

Thanks for sharing!! 🙂

When simple make it complicated… 😉

---

<div class="post-metadata">

**Author:** ![Anthony\_Attwood](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anthony\_Attwood](https://forums.unrealengine.com/u/Anthony_Attwood)\
**Post date:** [February 19, 2025, 12:49am UTC](https://forums.unrealengine.com/t/why-doesnt-my-usplinemeshcomponent-have-a-material/464925/4 "2025-02-19T00:49:38Z")

</div>

I can’t believe this is a thing… Thank you for this. Hard lesson learned, lots of time wasted
