Hey everyone, I am getting better and better at blueprints and I feel like I am grasping most of the larger concepts. One problem I keep running into and I think I have a basic conceptual misunderstanding of how some things work with world locations.
I want to make a new BP class from actor called Robert. Then I want to make another BP class from actor called Tim. While I am in Tim, I want to get the world location of the actor Robert. But I am seemingly having a tough time doing this. I feel like I have gotten something like that to to work by using get all actors from class, and then going to select Robert, then braking out the elements. But most of the time it wont let me brake out the elements.
Anyway, it seem like a relatively simple thing to do, getting a world space location of a specific actor, for use in another actors logic.
If the answer is that you have to do that all in the level blue print, then my question is why is that so? It seem like a huge limitation and being able to communicate between actors would be a powerful tool.
“While I am in Tim,”, we are open minded we dont care about youre preferences.
but seriously: get all actors of class ROBERT should do the thing. you make a for each loop and grab the outcome. if you only have one robert this will be your robert.
a different way would be using collisions or tracers to detect other players. but if you want to find him regardless of distance you need get all actors of class
Hello JordanService.
You do not have to do that in the LevelBlueprint.
And I’m a little confused what you excatly are asking. Are you spawning actors at run time? or are they allready in your scene before your press play? and what do you mean with braking elements what do yu want to do?
Hope I can help you
Oh about five minutes after posting I realized that I had a brain fart. I was thinking of the iteration of the class as the rules for the class it self. I forgot you had to make for each loop to get the specific iteration of Tim.
Well, one way would be to have an actor that spawn both Robert and Tim, and then store them in variables for easy access. If you spawn several of Robert and Tim, you can simply make the variables an array.
Other than that, I don’t think using GetAllActorsofClass would be too expensive, and to make things just a little more efficient you can use ForEachLoopWithBreak and break the for loop once you’ve found what you want. If you know what you want will be at index 0 - you can simply use the Get node with an Index of 0.