Announcement

Collapse
No announcement yet.

HELP! Creating copies of an actor at runtime (in-game)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    HELP! Creating copies of an actor at runtime (in-game)

    Hello all!

    I am wondering if anyone can help me, to what is probably quite a rudimentary task via BP scripting, correctly create SEVERAL COPIES of an actor (whilst in-game) and MOVE ALL OF THOSE COPIES to a location.

    I am trying to move multiple actors (in this case, sound spheres) for a sequence, but my system is only moving ONE instance of the actor (which is the latest instance of said actor). For example, the actor I am creating is called 'Sound_sphere_1_orbit' and when I am in-game, I am seeing several spawns of the same actor BP (i.e. Sound_sphere_1_orbit1, orbit2, orbit3 etc); however, even though these are from the same root actor BP, they are not moving...

    I realise I should probably have used child actors/instances of the main actor (sphere) but I have no idea which is the correct way to solve this problem.

    My thinking is that all actor instances/copies will only move when I use child actors/instances of the main actor (sphere), rather than the latest simple copy of the actor in question.

    Any ideas?...

    I attach pictures to help explain this.

    Thanks in advance!
    Attached Files
    Last edited by Crhodes1992; 06-30-2020, 01:30 PM.

    #2
    I never used it, but I think the "MoveComponentTo"-node does like the timeline-node not create a new instance of itself when called again. It initializes in the first round of the loop, then deletes the settings and reinitializes in the second round with the other component, then reinitializes in the third round etc. This is why it only works with the last component. I see two solutions at the moment: a) move the "MoveComponentTo"-node in the newly spawned actor. Then you'll have a copy of it for each of the actors. b) Make your own "MoveComponentTo"-actor component which creates timers for each added component or so. Or an array with starting- and end-positions and an array with the components and in the tick-event somehow move them all in a loop. But this may be a bit more complicated.

    Comment


      #3
      Originally posted by ThiloN1987 View Post
      I never used it, but I think the "MoveComponentTo"-node does like the timeline-node not create a new instance of itself when called again. It initializes in the first round of the loop, then deletes the settings and reinitializes in the second round with the other component, then reinitializes in the third round etc. This is why it only works with the last component. I see two solutions at the moment: a) move the "MoveComponentTo"-node in the newly spawned actor. Then you'll have a copy of it for each of the actors. b) Make your own "MoveComponentTo"-actor component which creates timers for each added component or so. Or an array with starting- and end-positions and an array with the components and in the tick-event somehow move them all in a loop. But this may be a bit more complicated.
      Thank you so much! I didn't realise that each copy of the instance was not being accounted for with the 'MoveComponentTo' node until you pointed it out. It is now working, as I break each index from the array and use several 'Move Component To' nodes to compensate! I realise this is perhaps a work-around solution, but at least it works for now. Thanks for all the help - this was a head scratcher haha.

      Comment

      Working...
      X