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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How can I prevent spawning an actor inside of another?

Hey all! I'm trying to make a system that disallows spawning of objects while my "Spawn cube" is inside of another object. I have linked a Youtube video of this "Spawn cube" for clarity. It is essentially a physics object that is being held in front of my player to show the player where they will spawn a cube when the correct input is given. Here is the link:

https://youtu.be/tp-Ju1xWS9A

Is there a way to prevent the spawning of physics objects while this "Spawn cube" is colliding with the other physics objects in the scene? Here is the setup that I am using to spawn the "Spawn cube" in front of the player.

alt text

Here is the setup that I am using to spawn the cubes within the "Spawn cube".

alt text

Let me know if there is any additional information that you need to help me out! Thanks so much!

Product Version: UE 4.13
Tags:
11.png (420.3 kB)
12.png (340.0 kB)
more ▼

asked Jan 21 '17 at 05:14 PM in Blueprint Scripting

avatar image

Anaklosmos
170 35 29 54

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

In the spawning node, you can say "try to adjust location, don't spawn if overlapping."

more ▼

answered Jan 22 '17 at 03:20 PM

avatar image

shotty46290
348 12 7 19

avatar image Anaklosmos Jan 23 '17 at 11:54 PM

This would work... however, the "spawn cube" that you see is actually a physics object that is being held in front of the player by a physics handle. I thought this system looked better and worked nicely, seeing as the player could not force the "spawn cube" into the ground because of the collision settings attached. When I set the spawn node to this ^^, I cannot spawn objects at all because the "spawn cube" would be overlapping. Is there a way to ignore the "spawn cube" when this ^^ setting is active on my spawn node?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Could you add a boolean variable 'isReadyToSpawn' which is set to false when an object is overlapping the cube collision box (and true on endOverlap) ? This way, you prevent your spawn cube from spawning when spawn area is blocked.

more ▼

answered Jan 24 '17 at 12:16 AM

avatar image

rvelasco
6 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Simply using the OnBeginOverlap nodes should do the trick.

Video here: https://youtu.be/CeVCso_DniI

SpawnBlockComment

SpawnCubeComment

ThirdPersonCharComment

more ▼

answered Feb 09 '18 at 08:21 PM

avatar image

Kmontoya
76 2 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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