# Effecting a single instance of a blueprint

**URL:** <https://forums.unrealengine.com/t/effecting-a-single-instance-of-a-blueprint/1751237>\
**Category:** Blueprint\
**Tags:** unreal-engine, question, Blueprint\
**Created:** [March 14, 2024, 10:16am UTC](https://forums.unrealengine.com/t/effecting-a-single-instance-of-a-blueprint/1751237 "2024-03-14T10:16:15Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![DoomBoxHero1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DoomBoxHero1](https://forums.unrealengine.com/u/DoomBoxHero1)\
**Post date:** [March 14, 2024, 10:16am UTC](https://forums.unrealengine.com/t/effecting-a-single-instance-of-a-blueprint/1751237/1 "2024-03-14T10:16:15Z")

</div>

How do you effect one instance of a blueprint if you have multiples of the same blueprint in a level?  
For example, I have a lock on system that when it locks on to the enemy it triggers a widget to overlap the enemy but it triggers on every enemy so they all have a widget overlayed on them.

---

<div class="post-metadata">

**Author:** ![omicron0806](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/omicron0806/32/910024_2.png) [@omicron0806](https://forums.unrealengine.com/u/omicron0806)\
**Post date:** [March 14, 2024, 10:29am UTC](https://forums.unrealengine.com/t/effecting-a-single-instance-of-a-blueprint/1751237/2 "2024-03-14T10:29:07Z")

</div>

So, You have ‘MainCharacter’ and ‘Enemy’ (instances of object enemy) right? Does enemy instance has some kind of interact widget?

 ![ss](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/d/2/8d25ca8fc7386237080a79053ce7287f1e22d3f0.jpeg)

For example. Red boxes are all of same Blueprint (class). But, let’s say OnOverlapEvent, only one shows InteractWidget, i.e. ‘E’… Is that something you’re going for?

---

<div class="post-metadata">

**Author:** ![omicron0806](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/omicron0806/32/910024_2.png) [@omicron0806](https://forums.unrealengine.com/u/omicron0806)\
**Post date:** [March 14, 2024, 10:45am UTC](https://forums.unrealengine.com/t/effecting-a-single-instance-of-a-blueprint/1751237/3 "2024-03-14T10:45:39Z")

</div>

I will insinuate that You have a global (world instantiated) widget, and probably instancing it on every class of ‘enemy’. If that’s the case I’d add ‘OverlapWidget’ to list of Components of ‘enemy’ class, set it’s visibility to false, and then when event is triggered (which should be just on the enemy you’re targeting), change visibility. That helps?

---

<div class="post-metadata">

**Author:** ![DoomBoxHero1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DoomBoxHero1](https://forums.unrealengine.com/u/DoomBoxHero1)\
**Post date:** [March 14, 2024, 8:41pm UTC](https://forums.unrealengine.com/t/effecting-a-single-instance-of-a-blueprint/1751237/4 "2024-03-14T20:41:06Z")

</div>

I have a lock on mechanic that is a capsule component that checks if the actor has the tag “Enemy”. When the tag is valid it also checks a boolean related to the actor and triggers the widget to display.

---

<div class="post-metadata">

**Author:** ![omicron0806](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/omicron0806/32/910024_2.png) [@omicron0806](https://forums.unrealengine.com/u/omicron0806)\
**Post date:** [March 14, 2024, 8:47pm UTC](https://forums.unrealengine.com/t/effecting-a-single-instance-of-a-blueprint/1751237/5 "2024-03-14T20:47:46Z")

</div>

Well, if all enemies have the ‘Enemy’ tag, it’s normal that the widget is showed on all of them. What about that other BOOL?

---

<div class="post-metadata">

**Author:** ![DoomBoxHero1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DoomBoxHero1](https://forums.unrealengine.com/u/DoomBoxHero1)\
**Post date:** [March 14, 2024, 9:01pm UTC](https://forums.unrealengine.com/t/effecting-a-single-instance-of-a-blueprint/1751237/6 "2024-03-14T21:01:02Z")

</div>

Thats the problem. The boolean is just a check that ticks when the target is valid which triggers the widget to display. The problem is that its setting it as true in the BP\_actor and reading as true for all of them. How would i make it only effect that individual enemy?

---

<div class="post-metadata">

**Author:** ![omicron0806](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/omicron0806/32/910024_2.png) [@omicron0806](https://forums.unrealengine.com/u/omicron0806)\
**Post date:** [March 14, 2024, 9:12pm UTC](https://forums.unrealengine.com/t/effecting-a-single-instance-of-a-blueprint/1751237/7 "2024-03-14T21:12:06Z")

</div>

OK… If we’re to solve this a bit of information is needed… So, just one enemy\_actor has ‘enemy’ tag?.. Where’s the boolean declared and what is it checking?  
Seem to me like all of your enemy\_players share some global variable… Which you’re checking.

---

<div class="post-metadata">

**Author:** ![DoomBoxHero1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DoomBoxHero1](https://forums.unrealengine.com/u/DoomBoxHero1)\
**Post date:** [March 14, 2024, 9:24pm UTC](https://forums.unrealengine.com/t/effecting-a-single-instance-of-a-blueprint/1751237/8 "2024-03-14T21:24:19Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/e/5/3e5a5a12a29bc422732bfaf1ea0955412bedffcc.jpeg)  
Picture 1  
So this runs through the code for setting up the lock on running the sphere trace for objects. At the end is when the EnemyLocked (boolean) is set. This was made so I could set a true or false in the Enemy BP.

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/5/9/a592704ca92e57e41067510cd7a7b43ad6477986.png)  
Picture 2  
This is the enemy BP It’s just checking if that boolean is true or not to set that widget to appear or not. That’s where my problem is. I know just setting it that way is what’s causing the issue, I just don’t know how to fix it or to only specifically effect the enemy that’s actually targeted.

---

<div class="post-metadata">

**Author:** ![omicron0806](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/omicron0806/32/910024_2.png) [@omicron0806](https://forums.unrealengine.com/u/omicron0806)\
**Post date:** [March 14, 2024, 9:42pm UTC](https://forums.unrealengine.com/t/effecting-a-single-instance-of-a-blueprint/1751237/9 "2024-03-14T21:42:02Z")

</div>

Well I’m not sure I quite understand all of this, but shouldn’t you just be checking if the hit\_actor has tag? I mean… In this way, parsing that boolean to EnemyBP all of them get it as TRUE.

i. e. if the enemy is hit a. i. traced-\>set\_true

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [March 14, 2024, 9:49pm UTC](https://forums.unrealengine.com/t/effecting-a-single-instance-of-a-blueprint/1751237/10 "2024-03-14T21:49:24Z")

</div>

It would be the same setup as in here but instead of a timeline, you’d fire widget visibility events:

> [@Moving an object by pointing another object at it](https://forums.unrealengine.com/t/moving-an-object-by-pointing-another-object-at-it/1657869/2):
>
> See if this point_down helps with this point_up_2 particular bit. a standard forward camera trace: You’d use an interface or inheritance if there are more types to handle, ofc. not sure how you want stuff to move, here it’s via a timeline: which results in: the branches in the script prevent it from spamming since we’re tracing on Tick: Hopefully you can adapt it to your needs. It’s a setup similar to this one:

In a nutshell, store a reference to what you’re looking at, so you can still interact with it (disable it) when you’re no longer looking at it.

* * *

And here’s a more resource-conscious alternative:

> [@How to get static mesh name and input it into widget](https://forums.unrealengine.com/t/how-to-get-static-mesh-name-and-input-it-into-widget/1430568/5):
>
> Since this can be done in too many ways, we’d need to know how you’re handling things at the moment in order to suggest something that fits right into your existing system. calling a bind variable assuming this is what you mean in the widget: [image] assuming we’re using an interface: assuming we’re tracing and looking at stuff: assuming actors carry names we predefine ourselves: The end result here would produce: As you can see I had to assume a lo…

Since we need only 1 lock-on widget visible at the same time, move the same widget from one target to another. The player owns the widget and moves it to where it’s needed.

---

<div class="post-metadata">

**Author:** ![DoomBoxHero1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DoomBoxHero1](https://forums.unrealengine.com/u/DoomBoxHero1)\
**Post date:** [March 14, 2024, 9:56pm UTC](https://forums.unrealengine.com/t/effecting-a-single-instance-of-a-blueprint/1751237/11 "2024-03-14T21:56:13Z")

</div>

Ok I’ll check it out thank you for your help!

---

<div class="post-metadata">

**Author:** ![DoomBoxHero1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DoomBoxHero1](https://forums.unrealengine.com/u/DoomBoxHero1)\
**Post date:** [March 14, 2024, 9:56pm UTC](https://forums.unrealengine.com/t/effecting-a-single-instance-of-a-blueprint/1751237/12 "2024-03-14T21:56:39Z")

</div>

Thank you for taking the time and helping me out!

---

<div class="post-metadata">

**Author:** ![DoomBoxHero1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DoomBoxHero1](https://forums.unrealengine.com/u/DoomBoxHero1)\
**Post date:** [March 15, 2024, 1:06am UTC](https://forums.unrealengine.com/t/effecting-a-single-instance-of-a-blueprint/1751237/13 "2024-03-15T01:06:14Z")

</div>

Ok so this kind of thing will work for a system I already have built?

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/c/9/7c9bb511c4bc58bac6d766dae08e59e9bf8873c7.jpeg "Unreal Engine Hack & Slash Tutorial Part 10 | Targeting System (DMC 5 Inspired)") ](https://www.youtube.com/watch?v=zNZjyMFsSkM)

This is the system my lock on is based on.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [March 15, 2024, 1:51am UTC](https://forums.unrealengine.com/t/effecting-a-single-instance-of-a-blueprint/1751237/14 "2024-03-15T01:51:17Z")

</div>

It’s a common, generic and pretty agnostic approach. Both of them are.

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [April 14, 2024, 1:51am UTC](https://forums.unrealengine.com/t/effecting-a-single-instance-of-a-blueprint/1751237/15 "2024-04-14T01:51:33Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
