# Material Switch node is behaving weirdly

**URL:** <https://forums.unrealengine.com/t/material-switch-node-is-behaving-weirdly/2705424>\
**Category:** Blueprint\
**Tags:** unreal-engine, bug-report, Blueprint\
**Created:** [March 11, 2026, 1:49pm UTC](https://forums.unrealengine.com/t/material-switch-node-is-behaving-weirdly/2705424 "2026-03-11T13:49:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akabane87](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Akabane87](https://forums.unrealengine.com/u/Akabane87)\
**Post date:** [March 11, 2026, 1:49pm UTC](https://forums.unrealengine.com/t/material-switch-node-is-behaving-weirdly/2705424/1 "2026-03-11T13:49:28Z")

</div>

Hey guys, I just wanted to be sure I did not miss something obvious before reporting a bug, so I’m asking to you guys first.

I’ve been struggling for the past few days with a sudden issue where my material function is triggering multiple nonsense errors outside of my material when I basically plug a scalar parameter on the value pin of a switch node through a scalar input function.

Here are the errors:

```auto
LogShaderCompilers: Warning: Failed to compile Material /Engine/Transient.NewMaterial1 for platform PCD3D_SM6, Default Material will be used in game.
Shader debug info dumped to: "C:\Users\akaba\Documents\Unreal Projects\Combat\Saved\ShaderDebugInfo\PCD3D_SM6\NewMaterial1_dc23684579b25847\Default\FLocalVertexFactory\FLumenCardPS\0"
C:\Program Files\Epic Games\UE_5.7\Engine\Shaders\Private\MaterialTemplate.ush(4449,145): Shader FLumenCardPS, Permutation 0, VF FLocalVertexFactory:
    /Engine/Generated/Material.ush:4449:145: error: scalar, vector, or matrix expected
        FLWCVector2 Local9 = step(0.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 1.000000) * Local7 +step(1.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 2.000000) * Local8 +step(2.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 3.000000) * Local5 +(step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 0.000000) + step(3.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f)) * Local5 ;
                                                                                                                                                       ^
C:\Program Files\Epic Games\UE_5.7\Engine\Shaders\Private\MaterialTemplate.ush(4449,280): Shader FLumenCardPS, Permutation 0, VF FLocalVertexFactory:
    /Engine/Generated/Material.ush:4449:280: error: scalar, vector, or matrix expected
        FLWCVector2 Local9 = step(0.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 1.000000) * Local7 +step(1.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 2.000000) * Local8 +step(2.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 3.000000) * Local5 +(step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 0.000000) + step(3.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f)) * Local5 ;
                                                                                                                                                                                                                                                                                              ^
C:\Program Files\Epic Games\UE_5.7\Engine\Shaders\Private\MaterialTemplate.ush(4449,415): Shader FLumenCardPS, Permutation 0, VF FLocalVertexFactory:
    /Engine/Generated/Material.ush:4449:415: error: scalar, vector, or matrix expected
        FLWCVector2 Local9 = step(0.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 1.000000) * Local7 +step(1.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 2.000000) * Local8 +step(2.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 3.000000) * Local5 +(step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 0.000000) + step(3.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f)) * Local5 ;
                                                                                                                                                                                                                                                                                                                                                                                                                                     ^
C:\Program Files\Epic Games\UE_5.7\Engine\Shaders\Private\MaterialTemplate.ush(4449,552): Shader FLumenCardPS, Permutation 0, VF FLocalVertexFactory:
    /Engine/Generated/Material.ush:4449:552: error: scalar, vector, or matrix expected
        FLWCVector2 Local9 = step(0.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 1.000000) * Local7 +step(1.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 2.000000) * Local8 +step(2.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 3.000000) * Local5 +(step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 0.000000) + step(3.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f)) * Local5 ;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ^
MaterialEditorStats: Error: [SM6] Shader debug info dumped to: "C:\Users\akaba\Documents\Unreal Projects\Combat\Saved\ShaderDebugInfo\PCD3D_SM6\NewMaterial1_dc23684579b25847\Default\FLocalVertexFactory\FLumenCardPS\0"
C:\Program Files\Epic Games\UE_5.7\Engine\Shaders\Private\MaterialTemplate.ush(4449,145): Shader FLumenCardPS, Permutation 0, VF FLocalVertexFactory:
    /Engine/Generated/Material.ush:4449:145: error: scalar, vector, or matrix expected
        FLWCVector2 Local9 = step(0.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 1.000000) * Local7 +step(1.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 2.000000) * Local8 +step(2.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 3.000000) * Local5 +(step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 0.000000) + step(3.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f)) * Local5 ;
                                                                                                                                                       ^
MaterialEditorStats: Error: [SM6] C:\Program Files\Epic Games\UE_5.7\Engine\Shaders\Private\MaterialTemplate.ush(4449,280): Shader FLumenCardPS, Permutation 0, VF FLocalVertexFactory:
    /Engine/Generated/Material.ush:4449:280: error: scalar, vector, or matrix expected
        FLWCVector2 Local9 = step(0.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 1.000000) * Local7 +step(1.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 2.000000) * Local8 +step(2.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 3.000000) * Local5 +(step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 0.000000) + step(3.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f)) * Local5 ;
                                                                                                                                                                                                                                                                                              ^
MaterialEditorStats: Error: [SM6] C:\Program Files\Epic Games\UE_5.7\Engine\Shaders\Private\MaterialTemplate.ush(4449,415): Shader FLumenCardPS, Permutation 0, VF FLocalVertexFactory:
    /Engine/Generated/Material.ush:4449:415: error: scalar, vector, or matrix expected
        FLWCVector2 Local9 = step(0.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 1.000000) * Local7 +step(1.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 2.000000) * Local8 +step(2.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 3.000000) * Local5 +(step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 0.000000) + step(3.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f)) * Local5 ;
                                                                                                                                                                                                                                                                                                                                                                                                                                     ^
MaterialEditorStats: Error: [SM6] C:\Program Files\Epic Games\UE_5.7\Engine\Shaders\Private\MaterialTemplate.ush(4449,552): Shader FLumenCardPS, Permutation 0, VF FLocalVertexFactory:
    /Engine/Generated/Material.ush:4449:552: error: scalar, vector, or matrix expected
        FLWCVector2 Local9 = step(0.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 1.000000) * Local7 +step(1.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 2.000000) * Local8 +step(2.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f) * step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 3.000000) * Local5 +(step(floor(Material_PreshaderBuffer[1].x) + 0.5f, 0.000000) + step(3.000000, floor(Material_PreshaderBuffer[1].x) + 0.5f)) * Local5 ;
                                                                                                                                                                                    

```

And here is the material function:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/6/a/f6ae4f6c75cd43020e31dfeb852ee4a4e179cdda.png)

> **[MF\_WorldPosToUVProjection posted by anonymous | blueprintUE | PasteBin For...](https://blueprintue.com/blueprint/rak90yhu/)**
>
> No description provided

And here is a simple basic usage to trigger the error:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/8/7/987fc6c9aee70de9d60b9a4cdf6fca3514e73d27.png)

> **[Crashing usage posted by anonymous | blueprintUE | PasteBin For Unreal Engine](https://blueprintue.com/blueprint/54pd66tq/)**
>
> No description provided

If I convert the scalar parameter into a constant then everything is working as expected and if I generate a dynamic value for that axis selection it works too. But for some weird reason, I can’t pass a scalar parameter into that function… The most crazy thing here is that if I use that same scalar parameter directly inside the material function instead of a scalar input, then everything works fine too.

So what do you guys think about this, is it a bug or just me doing crappy things?
