Hey
So I wanted to make an custom node to find the actor in any actor array, since contains item doesnt go through all the elements in the array
So If the object name matches the given name i want it fire print string and say “true” if it doesnt just “false”
Here is what I have so far:
Hi there,
you just need to use the LoopBody execution path instead of the Completed path. Then it should work as expected.
Perhaps you want to check out these tutorials (9-For Loops to 12 For Each Loop), to gain more understanding of usage.
You probably want to use For Each Loop or For Each Loop with Break, depending on what you want to achieve with.
Sorry, I actually started to create you a blueprint sample, but i thought you will be more happy about these tutorials to avoid further struggles with basics
Yes, adding is proper way. Or rather one of proper ways. There are nodes like Add, AddUnique and Insert.
But again, It’ll be easier to find the problem if you’d just show me the things I asked above. Without it, it’s just guessing game with lots of possible answers.
You could try to double check name of newly added object to the array.
Also, before executing FindActorInTheArray function, you could try to print names of all objects and see if these are valid.
Also, I’m not sure if it’s intended (as you wanted to have a function that searches for ACTOR in array of ACTORS), but you’re adding static mesh to the array. That means, the array cannot be an array of actors. And when you get a name of a component, returnes name sticks to the pattern: . (e.g. CharacterPlayer.Mesh)
That could be possible cause why it wouldn’t find that object if you’d search for it.
I believe GetDisplayName would return none, only if it would be actual name of the object (which is pretty rare :p) or if the object whose name you want to get is null.
Maybe your objects got destroyed somewhere between you add them to the array and call the function?
Also if use get display name and choose it from the content browser it works fine but if i use it from the casting it displays nothing if i use it from the array it displays none
I really dont think this a specific-project issue and if i were to reproduce it .it’d require to rebuild the whole thing again
the problem is not with the array im sure its with the casting or.some sort.
can you import a ststic mesh and make a blurprint of that and cast it in the.firsperson bp and get the display game to seeif that works for you?