# controlling a StaticSwitch with a Float/Scalar/Constant 1 in a Material

**URL:** <https://forums.unrealengine.com/t/controlling-a-staticswitch-with-a-float-scalar-constant-1-in-a-material/299743>\
**Category:** Rendering\
**Tags:** bool, float, unreal-engine, question\
**Created:** [November 24, 2014, 2:29pm UTC](https://forums.unrealengine.com/t/controlling-a-staticswitch-with-a-float-scalar-constant-1-in-a-material/299743 "2014-11-24T14:29:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DarknesZ](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/darknesz/32/610815_2.png) [@DarknesZ](https://forums.unrealengine.com/u/DarknesZ)\
**Post date:** [November 24, 2014, 2:29pm UTC](https://forums.unrealengine.com/t/controlling-a-staticswitch-with-a-float-scalar-constant-1-in-a-material/299743/1 "2014-11-24T14:29:12Z")

</div>

Hey Guys, i want to control a StaticSwitch with a Float…  
currently iam trying to do this with a IF Node.

 ![22007-static.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/3/1/7312c473ce458bca74c61885056299d47c31cd2e.png)

but i get an errors  
Error [SM5] (Node If) Attempting to perform arithmetic on non-numeric types: static bool static bool  
Error [SM5] (Node If) Cannot force a cast between non-numeric types.

i want to control the switch out of the cascade editor via the dynamic parameter. so it have to be a float.  
is there a way to convert a float to a bool ??

---

<div class="post-metadata">

**Author:** ![Lovecraft\_K](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lovecraft\_K](https://forums.unrealengine.com/u/Lovecraft_K)\
**Post date:** [November 25, 2014, 5:03pm UTC](https://forums.unrealengine.com/t/controlling-a-staticswitch-with-a-float-scalar-constant-1-in-a-material/299743/2 "2014-11-25T17:03:40Z")

</div>

Hey DarknesZ -

Your big problem is going to be getting the Switch to function at all. Despite its tag in the Material Editor, it is actually known as a Static Switch because it will only exist at compile time and not at runtime. So even if it were possible to pass a Dynamic Parameter into the Switch you would not be able to change the value in Cascade.

However there is an easy replacement, use a LERP. You would just need to make sure that Cascade only every receives a hard 0 or hard 1 and you would not see the fade from one to another. In this case simple plug the Dynamic Parameter directly into the LERP’s alpha.

Thank You

Eric Ketchum
