# Material deciding a branch outcome

**URL:** <https://forums.unrealengine.com/t/material-deciding-a-branch-outcome/430378>\
**Category:** Rendering\
**Tags:** condition, branch, unreal-engine, UE4, Blueprint, question\
**Created:** [July 27, 2018, 11:43am UTC](https://forums.unrealengine.com/t/material-deciding-a-branch-outcome/430378 "2018-07-27T11:43:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_15de4253](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_15de4253](https://forums.unrealengine.com/u/anonymous_user_15de4253)\
**Post date:** [July 27, 2018, 11:43am UTC](https://forums.unrealengine.com/t/material-deciding-a-branch-outcome/430378/1 "2018-07-27T11:43:19Z")

</div>

I’m currently editing a Rocket League type game which I have not made myself. In this game I am trying to set up parameters based on the distance between two players. In the blueprints the player is auto assigned a coloured material (either red or blue).

I was wandering if there is a way create a branch node where the condition is effected by materials e.g

If Orange Material - Branch = True

---

<div class="post-metadata">

**Author:** ![redbox](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@redbox](https://forums.unrealengine.com/u/redbox)\
**Post date:** [July 27, 2018, 11:54am UTC](https://forums.unrealengine.com/t/material-deciding-a-branch-outcome/430378/2 "2018-07-27T11:54:52Z")

</div>

It’s strange flow. Color in material should be a consequence, not cause.

Use some property to specify player “type”. Maybe team index, or something else. Color players materials according to this property. And use it for other branches/conditions.

---

<div class="post-metadata">

**Author:** ![Placinta8](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Placinta8](https://forums.unrealengine.com/u/Placinta8)\
**Post date:** [July 28, 2018, 3:30pm UTC](https://forums.unrealengine.com/t/material-deciding-a-branch-outcome/430378/3 "2018-07-28T15:30:19Z")

</div>

![248804-material-branch.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/2/4/6240578f16f135076dd45e83d0ede5244c9a190d.png)

Set the material you want to check in the == node and replace the static mesh component with your static mesh component / skeletal mesh.
