Target lock issue (two instances spawning)

Hello, I’ve recently begun to be interested into learning unreal engine, and currently I’ve been following this tutorial made by a YouTube channel called “gorka games“ for creating a basic soul-like prototype using blueprints. currently I’m on the “target lock“ section of his tutorial and I managed to get the target lock itself to work, however for some reason a second instance of the icon spawns in the geometry underneath where the default character spawns, and there doesn’t seem to be an actor there that would trigger it.

Additionally, while clicking again on an enemy it disengages and the icon despawns like I’ve programmed it to, the second instance will never despawn, and while this second lock on is active both will begin to flicker.

reading the message logs it shows a repeating blueprint runtime error: “accessed none trying to read (real) property ‘target lock actor’ in BPC_combat“. Looking online one suggestion I’ve seen was to use an “is valid“ node to fix it, however I’m not quite sure where in my blueprint I would place it. If anyone more experienced than me would be able to provide some insight or is able to provide an explanation that would be greatly appreciated!

https://youtu.be/Hs2sM7eFf6Q?si=C7lb8iTduMDfxj4e

Hey @ThisKidRghtHere! Welcome to the forums!

An important piece of information here would be: Does that widget exist BEFORE you’ve locked on to anything? Is it there at game start? It may be that if you have a widget component you’re using for this, it needs to be set to “Hidden in Game” or something to that effect!

Also, when reading those message logs and getting the “Accessed none” issue, you can click on the magnifying glass to take you to the specific node where the issue is located.

I think it’s possible that both of these problems are simply happening in a different location in the code than you’re thinking, which is why you’re having a hard time! Try both of those things and get back to us! :slight_smile: