Spawner-How get his location for Task

Hi. I have BP_Spawner. and it spawn AI on random position around spawner. Problem is in AI moving base on random location of Controlled Pawn…
FindRandomWalkPosition is Task in behavior Tree.

my question is how to change it to Random position around spawner not around AI ?
I traied something like this but fail… I dont know how cast to Spawner_BP…

And here is thet Spawner_BP

In order to cast to your Spawner_BP you need to pass through the spawner itself if you want to use it.
So quick example of when you’d use a casting node.

Get all Actors with Tag>ForeachLoop>CastToSpawner_BP.

But if you’d send a reference from the Spawner_BP to the AIController there is no need to cast it since it already knows what type of object it is.

Example:
Create a variable on your Character(or Pawn) called Spawner_BP and make sure “Expose on Spawn” is set to true.

Image: Screenshot - 78447d68a19619783a1c83aa9304b509 - Gyazo

Then when you Spawn the Character you have this option available on the SpawnActorOfClass since it is available on Spawn. Then hook up self in the Spawn_BP pin to send the Spawner_BP reference that was responsible for spawning the Character.

Image: Screenshot - f30fe5c4aec72f329f50dae4b58a518c - Gyazo

I am unsure on what exactly you want to achieve though since you are phrasing it a bit unclear, if you can give me a clear description of what exactly you want to achieve I can give you a solution.

Now that I read your title more clearly what I think you are asking is how to get the location of the Spawner? if so then you can use the same method to send through the location vector and save it on the character.

I want my AI to spawn at a random position around the Spawner(iam done) and then walk around a random position around the Spawner. for now he was walking around a random position around the pawn ( First image - Task - behavior tree )

btw. I want to place multiple spawner with diferent setup and AI… SOmething like in MMO if you have Admin rights…

Right so you need to send through the Spawner_BP location to the BTTask, you can also set the BlackBoard vector for the random location in your AiController. So instead of doing that logic in a task you can do that in your AIController since you can get to the owning pawn of the Controller to get the Spawn_BP’s Location if you have followed the logic that I have shown you in my original post.