# How can i set only SpawnRight's location when SpawnRight is selected

**URL:** <https://forums.unrealengine.com/t/how-can-i-set-only-spawnrights-location-when-spawnright-is-selected/450932>\
**Category:** Blueprint\
**Tags:** duplicate, unreal-engine, learning, Code, Blueprint, question\
**Created:** [June 19, 2019, 2:33pm UTC](https://forums.unrealengine.com/t/how-can-i-set-only-spawnrights-location-when-spawnright-is-selected/450932 "2019-06-19T14:33:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MetaneL](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MetaneL](https://forums.unrealengine.com/u/MetaneL)\
**Post date:** [June 19, 2019, 2:33pm UTC](https://forums.unrealengine.com/t/how-can-i-set-only-spawnrights-location-when-spawnright-is-selected/450932/1 "2019-06-19T14:33:39Z")

</div>

I want to set spawnright’s location when is on left is true (SpawnRight selected). There is a way by duplicating the code but i just want to know if i can do it without duplicating.

[this is my code] ([Bp - Album on Imgur](https://imgur.com/a/U6LxdZ3))

[thats what i want to do and how its done by duplicating the code (works fine)] ([Imgur: The magic of the Internet](https://imgur.com/a/3GUVB3e))

I can use it like that. I guess its not that bad because its not too much code that i duplicated but people say duplicating the code is a bad thing (maybe because its confusing to read or lower performance idk the reason) but if thats true and there is a way to do it without duplicating, i want to learn.

I hope you can help, thanks.
