Help Varest spawn effect!

Hello I am using Avrest plugin , when I get a json object I split it and recover a numeric value 1 or 0 , the issue is that I want to spawn a character when the value is 1 and despawn when its 0 , but the blueprint I did is not working, can someone help me understand why and make it work ?

here it is

where I get the data from :slight_smile:

Here the splitting and selection of the data value I want :

and here the final part where supposely it should spawn the character, there is a target with a tag inside the game, I tested with a button on click event and it works it spawns but doesn’t when I connect to the varest value … .can someone help me and explain me how to fix ?

Thankyou :slight_smile:

Could it be that the number you are trying to compare is not “1,0” but “1” or " 1"? Can you try to get the string and drag off of the pin from the string and e.g. use a “Contains”? Or first let the number be printed on your screen?

sorry how I do that?

To print the number:
Instead of using the branch use a PrintString node and connect your GetStringField output from “field3”.

To use “Contains” drag off of the output pin from “field3” and then type in “Contains”. This node can than be used with a branch instead of your “Equal” node.

can you make a little visual to show me how to connect all those?

Sure, one moment


Like this?

1 Like

I try , all the rest seems correct to you?

Your CallURL doesn’t show the other settings which are not connected, is that intended, edited in the image, a bug or an addon? I mean the settings like URL, Verb, Content-Type…

they are connected , all works if I put a click button but not if i gather data from avrest seems.

Oh and using the print screen keeps printing a blue “1” on the screen ,
untill after an update prints a 0 .

but when I connect to the function to spawn the character , doesn’t spawn anything .

Ok, then you can try:

  1. Add a PrintString to the function to check if it gets called
  2. Add a PrintString to print the location for your spawn
  3. Check the outliner if the AI gets added but it is maybe at the wrong location
  4. Try NoCollisionFail

Actually I retried to connect click button but now doesnt work anymore even the spawn on click button , dunno what happened…

this is how is connected the on click button …

I tried testing and
the prints work , after clicking it prints the location of spawn , and it prints after the spawn , but nothing spawns, there is no AI spawned in the outliner.

Can you try to spawn the “TutorialCharacter” as PawnClass at a free, self set location like 0,0, 100?

I tried to spawn the tutorial character at 000 and nothing spawned.

Ok I noticed that if I move the target here, if I click it spawns the AI …

But if I move the target here …

It doesn’t … why ? What can be the issue?

What happens if you set the target point above the ground or check NoCollisionFail?

If I move in the position where should spawn obut put it above ground spawns, dunno where to find nocollisionfail?

Also the other issue is that now if I link to the VA rest blueprint block it works, it spawns the char but it keeps spawning one char every 2 secs more or less… I would like to spawn only one and only if the var is at “1” , what can I add to limit ? or check if there is already a spawned char?

NoCollisionFail is an input on the SpawnAI node. To limit the spawning you could use the DoOnce node or check if the spawned actor is valid and then spawn.