How would I reference a newly spawned character?

Hey all,

So I am trying to have one character (character 2) fellow another one (character 1) as soon as it spawns. How ever all I can get to work is having character 2 go to the spawn point of character 1. I read a little bit about setting up an array to reference the new character but they weren’t to descriptive on how to do so. If anyone has any ideas then definitely let me know.

Assuming you’re using the “spawn actor from class” node - it has an object as a return value.

That object can be promoted to a variable and stored as a reference to your newly spawned character.

If only 2 characters are involved, an array won’t be needed. An Array would be appropriate if you had to track references for multiple characters

If character 2 is to follow character 1 - the logic should be to get actor location of Ch1 - move to it - check to see Ch1 and Ch2 locations are =

Hope this helps!

If you want more general info on creating references for many different situations check out video #25 in the link below. Otherwise the answer given is exactly how I would go about it for this particular case.

Arrays can cause a lot of problems. It can work, but it would be a lot easier to use a Blue Print Interface. When character 1 spawns, have it fire off an event that character 2 will receive.

In that event is where your follow logic would be. That way it will only follow when character 1 spawns.