Hello,
I want to remove all actors with the same name. It should definitely be used Get Path Name, because I have plans for it.
This doesn’t work.
Hello,
I want to remove all actors with the same name. It should definitely be used Get Path Name, because I have plans for it.
This doesn’t work.
That is one strange piece of code.
You could just put a begin play on the start because, bear in mind, that tick runs EVERY frame. Do you really want to do this whole thing 120 times per second?
The sequence node does 0 then 1, not 0 and 1 at the same time. So you can’t compare stuff from the first seq with the second, because by the time the second loop is running, the first one is long gone.
Also, you’re doing the same thing in both loops, so of course the actors would have the same names, but not necessarily in the same order ( using path names to control actors probably won’t work in a packaged build ).
Why bother getting the name if you’re going to destroy the actor anyway?
So, in short: Replace tick with begin play and remove the second loop and all path name stuff and it probably works ( will remove all cube x actors ).
I used destroy to see the result. I would like to compare several existing actors. I want to compare multiple existing actors with new added actors, whether the actors are the same? What is the best and easiest way to do this?
Thanks in advance for your support.
So when you add new actors, you want to know if they are the same class as existing actors?
You can make an array of all actor classes you have in the level. When you come to spawn a new actor, you can check if the class is already in the array.
So you only want one of each class? Otherwise, how do you know how many to keep of each class?
Actors are collected at level 1 and emptied at level 2.
I want to see the full path to the object with the Get Path Name, also the level name
Thanks for diagram. I’m sorry to say, I’m still confused.
You want anything collected in level 1, not to be in level 2. But they wouldn’t be anyway, right? It’s a different level.
Let’s say I have a cube and a sphere in L1. I take the cube. Then I go to L2. What is supposed to happen?
Like I say, I don’t think you can rely on path names after packaging, not entirely sure.
The actors from level 1 and level 2 are the same. When I transfer the actors from level 1 to level 2, the actors should no longer exist in level 1, but in level 2 I want to store it again.
Ah… so I pick them, and they vanish from L1, and then I see them in L2…
Yes
You have to do it with the save game. You COULD do it with the game instance, but that’s not going to work when the player decides to quit before they get to L2.
Also, you CAN do it with just static mesh actors and a horrendous wadge of code in the level BP, but it’s MUCH easier to make the actors blueprints, then you only have to write a little bit of code once, and everything works after that.
Basically, each BP makes a note of it’s transform on begin play and, if they player picks it, it disappears and puts a note in the save game to appear on the next level.
Shall I write a bit of code?
c++?
please only blueprint if possible
I meant BP, of course…
Gimme a little while…
Ok. Level BP, level 1
In the save game
You need a BP in each level which re-spawns the actors:
And the pickup BP is
You have to make the mesh variable on this BP ‘expose on spawn’
Thank you for your support!
Tell me how it goes
it works perfectly, as I wanted to have it
Cool…