x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to spawn specific Actors after other specific Actors are destroyed?

So here's the situation: I'm working on a VR assignment for a class. In my project, I need to have an actor (in this case, a dirty dish) fall through a water plane, get destroyed after a 5 second delay, and once it's destroyed, immediately have it reappear "clean" nearby. I've got the destroying of actors and delay down, and even managed to make the actors respawn as soon as the original is destroyed, but where I'm running into real trouble is I need to have the original actor (the dirty plate, for example) be destroyed and then have a different actor (the clean plate) spawn elsewhere.

How can I accomplish this? Trying to GetActorsOfClass wasn't working for me either. I'm assuming the solution lies within using the gamestate or Manager and an array, but can't figure it out. I have been searching for an answer to this question both online and through trial and error for three days now, and haven't resolved it. Any help would be immensely appreciated!

Product Version: UE 4.15
Tags:
more ▼

asked Jul 02 '18 at 02:08 PM in Blueprint Scripting

avatar image

Comasleep
6 1

avatar image ThompsonN13 Jul 02 '18 at 02:13 PM

so whats your question? it seems like youve solved your issue according to what you wrote in the first paragraph.

the script should be something like event overlap (with water) -> delay (5s)-> set visible (self false) -> spawn actor of class -> destroy actor (self). then all you need to do to have the spawned actor appear in a different place is to set the location portion of the transform.

avatar image Nebula Games Inc Jul 02 '18 at 02:18 PM

Yea this doesn't make sense...I think I read it too quickly and thought he had issues spawning the "clean" dish. But according to him:

"I've got the destroying of actors and delay down, and even managed to make the actors respawn as soon as the original is destroyed, but where I'm running into real trouble is I need to have the original actor (the dirty plate, for example) be destroyed and then have a different actor (the clean plate) spawn elsewhere."

Not sure what that means to be honest haha

avatar image Nebula Games Inc Jul 02 '18 at 02:19 PM

Maybe the issue is spawning the new actor "somewhere else"....in which case I recommend changing the transform "location" to whatever you desire.

avatar image Velrin Jul 02 '18 at 02:40 PM

What is the difference between the dirty plate actor and the clean plate actor aside from the appearance?

Is it possible to have one actor that can switch mesh/materials/position instead of destroying/creating a new actor?

avatar image Comasleep Jul 02 '18 at 03:13 PM

Is it possible to have one actor that can switch mesh/materials/position instead of destroying/creating a new actor?

This is totally allowed, but I wasn't aware it was doable frankly. If this is possible without being infinitely more elaborate, it's the ideal solution.

I apologize for any redundancy or vagueness in my question.

avatar image Comasleep Jul 02 '18 at 04:18 PM

What I'm having trouble with is how to make sure that the spawned actor is the same type of dish as the one that was destroyed. For instance, if a dirty plate is destroyed, I need a SpawnActorFromClass to spawn a clean plate, but I can't preemptively select my cleanPlate class (within the SpawnActorFromClass node) or else only clean plates will spawn in my spawn transform, even if a dirty cup or fork, or pan, etc is destroyed.

Is there a way to Get the type or tag of each dirty dish and tell the SpawnActorFromClass which clean dish to spawn specifically with that information?

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Why aren't you simply using "spawn actor from class"? Spawn dirty dish, it falls through water plane, waits 5 seconds, "spawn clean dish", destroy dirty dish, problem solved.

more ▼

answered Jul 02 '18 at 02:13 PM

avatar image

Nebula Games Inc
4.9k 27 9 14

avatar image Nebula Games Inc Jul 02 '18 at 05:40 PM

This is what @Velrin means

alt text

alt text

dishes-part-1.jpg (190.6 kB)
dishes-part-2.jpg (251.7 kB)
(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question