Announcement

Collapse
No announcement yet.

Save a spawned actor then loading

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

    Save a spawned actor then loading

    I have a set where the player spawns as many actor he wants from a Hud Button and place it where he wants. I'm trying to save these spawned actors adding them into a array stored in my save game BP. I tried to save the actor and the transform in various ways, from the moment this actor is placed, from the moment the actor is spawned and I use a print strig to check where it was stored in said array, but then it always prints the position -1 (I believe it is implying that it was not added) or then is always stores the spawned actor in position 0, overwriting the previous one. and after saving, when I do the loading of the level, it needs to spawns the actors of the array in the position the player had stored previously. How can I make this work please?

    #2
    All you need to store is the actor itself, the actor contains all of it's own data. The problem is that once you unload the levels, it removes the actors, meaning that the actors in the array are now nullified (I think). I suggest that you store each actor's class, and each actor's transform in 2 arrays, and then when you load the level, just do spawn actor from class, and use the transform array to get the transforms.

    Oh, and make sure that you resize the arrays to something greater than 0 before adding items, otherwise items won't be able to fit.
    Marketplace Assets

    Advanced Mobile Input: Marketplace Page | Support Thread ――― Easy Input Remapping: Marketplace Page | Support Thread
    Multiplayer Blueprint Chat System: Marketplace Page | Support Thread ――― Closing Credits System: Marketplace Page | Support Thread
    Minesweeper Template: Marketplace Page | Support Thread ――― Maze Creator: Marketplace Page | Support Thread

    Comment

    Working...
    X