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. 

Dynamically spawned actors collide with themselves, I wish they didn't

I have a level blueprint that is randomly spawning 4 blueprint actors in my level, with random velocities. I need those actors to have active collision (so I can shoot them up) but I want them to ignore collision with just each other. I can't quite figure out how to exclude them from hitting each other, since I spawn them in the level blueprint instead of have them placed more implicitly in the level to begin with.

Basically I'm trying to make a simple asteroids clone, and my asteroids need to pass through each other, but still get shot up and hit the player.

Product Version: Not Selected
Tags:
more ▼

asked Apr 11 '14 at 05:20 AM in Blueprint Scripting

avatar image

$1.99 Taco Combo
76 2 2 55

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

2 answers: sort voted first

Someone posted this answer, but it seemed to only be sent to me. So I thought I'd repost it here so other people can see it, it thoroughly answered the question. Thank you "cancel", mysterious answerer.


We're going to add custom collision for your asteroids. In the UE4 editor, go to Project Settings. Click on the 'Collision' page link on the left. You should see two main boxes on this page -- Object Channels, and Trace Channels. We're only worried about Object Channels today. Click the "New Object Channel..." button. Give it the name "Asteroid", and make its Default Response 'Block' (it should already be set that way, but just make sure). Click 'Accept', then click 'Set as Default' to save the changes. Close the Project Settings window.

Find the Asteroid Blueprint that you're spawning into the world. Open the Blueprint Editor for it, and switch to the Components tab. Now, I'm not sure what Components you have in your Asteroid Blueprint, but there is probably a mesh, and there might also be a Sphere or another primitive shape, depending on what you started with. If there is no primitive shape, that means UE4 is using the mesh for collision, which is what we want for this example.

If there is a primitive shape, that means either of them could be used for collision, which we probably don't want. Therefore, if there's a primitive shape component (Sphere, Capsule, Box, etc.), delete it from the components. If it's the root component, you'll first need to drag and drop the mesh component into its place before the editor lets you delete it.

Now, select the mesh component, and then scroll down in the Details palette until you see the Collision section. Find the 'Collision Presets' dropdown, and then select 'Custom...'. This is where we set how the custom Collision behavior for the Asteroids. First, we need to set its 'Object Type' to Asteroid, which means it will be placed into the Asteroid channel (that we we created earlier) when UE4 is calculating collisions. Now, under the 'Object Response' list, we get to choose how this Asteroid Blueprint will react to other object channels in the world. Probably the only want we want to change is the 'Asteroid' one: set it to Ignore!

Now, since your Asteroid Blueprint entities will all be placed into the Asteroid object collision channel, and since they are also set to ignore the Asteroid channel, they should all pass freely through each other in the game.

Hope that helps clear up custom collision for anyone else just getting started :)

more ▼

answered Apr 23 '14 at 04:52 AM

avatar image

$1.99 Taco Combo
76 2 2 55

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

Try setting Collision Preset to OverlapAll

more ▼

answered Nov 10 '15 at 01:45 PM

avatar image

MaximDC
46 2 6

(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