Is it possible to spawn characters in player's team with vector3 variables from a script component?
I've been trying iterating combatants in the current group and, for each combatant, getting a variable from a component, storing it into a variable and trying to pass it to a "Spawn Combatant node".
The main idea avoiding introducing spawners is to use this event in some other scenes, but i don't know if it possible not to use them.
Here's my failed try:
General view of the nodes:
The actual component that holds the position of a combatant:
And, node by node, that would be the order:
Select Combatant:
Select Selected Data:
Field To Variable:
Spawn Combatant:
I call this event in the start event, after adding combatants to the team in other event:
And i think it doesn't find the component of combatants, because, when starting the game, i obtain the "faied" dialogue.
But the actual component is in the combatant's prefab and i have tried accessing a combatant prefab's component before, so i dont't know where the fail is:
For sure I have made several mistakes, but, is it possible spawning combatants as npcs to talk to them in the map this way?
combatant.Object.Spawn(position, false, 0, false, Vector3.zero);
Use a Call Function node to call the function and the combatant spawns there.
Edit: The Field To Variable node stores the value of a field, but you entered the name of a function instead. The field's name is spawnPosition in your component :)
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!