Download

Compare Actors with Line-Trace

Hey Folks,

i got a problem.

I have multiple Actors within my Level, but one of them should never be deleted when the player wants to delete an Actor.

I tried to compare the “Hit Actor” from the Linetrace with the Actors that are allowed to be deleted, but i don’t get correct results from the Trace. (I never get a “true” for Actor “A” when i am aiming at “A”…)

Any workarounds? [I just want to “ignore” a certain Actor when deleting something within the game]

http://www11.pic-upload.de/17.08.15/zevqgtd3t8np.jpg

You need to get a reference to the actor you don’t want deleted. Then hook that reference(variable) up to the 2nd input of the Object == Object node.

This does not work, because the Actor ingame has the following name: “YK_Block_BP_A_C_0”, but i can’t get a reference to this, since i never named it like that -.- (this is something the engine itself added, and this is why i cant get a correct result from it - the correct Name is “YK_Block_BP”)

Got this information from Print-String with my line trace.

====================================
Can i check for a certain word within the name, and compare it with the hit-result. (this would ignore the additional letters and numbers)
Checking for “Instanced Static mesh” should do the trick too, i think. (the thing that should stay is instanced)

“YK_Block_BP_A_C_0” is the name of that actor’s instance. That is how the engine differentiates multiple actors of the same type. So you could have 3 actors of type “YK_Block_BP” in your level, and each one will have their own unique name. Do you only have one “YK_Block_BP” in your level or do you never want actors of type “YK_Block_BP” to never be deleted? If yes, you could just cast Hit Actor to “YK_Block_BP”. If the cast fails, you delete that actor.

There is only one Actor with this name.

But The “EditorName” differs from the “NoEditorName” - so i checked for both, and set e variable -> works.

I tried something different, that worked - a bit “stupid” to be honest, but it’s not stupid if it works >.<
http://www11.pic-upload.de/17.08.15/6se2xhgewjk.jpg