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"

[Feature Request] Ability to disable collision between two physics FBodyInstances

Hello,

I would love to see a C++/blueprint function in Unreal Engine to disable all collision (blocking and overlaps) between two arbitrary FBodyInstances or PrimitiveComponents, similar to this Unity function:

http://docs.unity3d.com/ScriptReference/Physics.IgnoreCollision.html

This would be a very useful addition to the existing collision channel filtering system and make the physics in Unreal Engine extremely customizable. It appears that only skeletal mesh components support this kind of filtering at the moment via FPhysScene::CollisionDisableTableLookup.

I am aware of PrimitiveComponent's MoveIgnoreActors, however this does not appear to affect blocking collisions, only overlaps.

Thanks, Michael

Product Version: UE 4.7
Tags:
more ▼

asked Jun 05 '15 at 06:20 AM in C++ Programming

avatar image

sds-michael
156 9 15 23

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

3 answers: sort voted first

Hi Michael,

I've looked it over and it seems like this would be a useful feature when presented with the limit that collision channels have when it comes to numbers. I've played a feature request into our system for the function. For your reference the number is UE-16728. While I can't guarantee that the request will be fulfilled, I will be sure to update you here with any updates to its status.

Have a nice day,

Matthew Clark

more ▼

answered Jun 09 '15 at 02:01 PM

avatar image

Matthew J ♦♦ STAFF
31.8k 526 92 417

avatar image sds-michael Jun 10 '15 at 01:31 AM

Thanks very much Matthew, really appreciate it.

avatar image Teiwaz Apr 10 '19 at 05:28 PM

Is there any way to check on this? This issue predates the move to the new tracker and UE-16728 is either missing or private. We're coming up on 4 years and as far as I can tell this is still missing functionality.

avatar image Matthew J ♦♦ STAFF Apr 10 '19 at 05:36 PM

Hello Teiwaz,

This was entered as a feature request and those are not visible in the public issues tracker. I've checked it personally however and it's still currently marked as backlogged. Unfortunately I don't believe this will be added any time in the near future, with how long it's been in this same status.

avatar image Teiwaz Apr 10 '19 at 06:02 PM

Well, thanks for looking into it.

Is it possible to... like... poke it with a stick, or something? I waded through a dozen or so forum posts, reddit threads, and other answerhub questions, all about this issue before I got here. It's pretty fundamental functionality which is supported by PhysX, but just not exposed by UE4. (Or was partially exposed in 4.20 but the work was never finished.)

From what I've gathered, it's fairly easy to do if you're willing to edit engine code, but a huge pain in the butt if you're not. I'm going to keep digging, but PhysX gives me headaches (not naming variables doesn't make code run faster, Nvidia!) and UE4's interface with it is... labyrinthine.

avatar image Matthew J ♦♦ STAFF Apr 10 '19 at 06:21 PM

Unfortunately I have no real say in if it is implemented or not. Additionally, with the recent announcement of Chaos at GDC, it's possible that any changes related to PhysX may be completely on the back burner but I'm not privy to the Physics team's current goals.

avatar image Teiwaz Apr 10 '19 at 06:44 PM

Ah, thanks for bringing that to my attention. If PhysX is being replaced entirely in UE4 in the reasonably near future (presentation on Chaos says preview in 4.23?) then it's really not worth me putting more time into this right now. I'll just hold off until the new physics stuff shows up.

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

Hi Matthew,

Thanks for the quick reply! I'm not talking about characters though - I'm talking about arbitrarily disabling/enabling collision between any two FBodyInstance pairs anywhere in the physics scene at any time. This would be a very powerful bit of functionality, and is something the UE4 collision filtering system can't approximate right now, especially with the 32 collision channel limit. I believe this is the reason Unity added their Physics.IgnoreCollision function.

Please understand that adding this functionality wouldn't replace the collision filtering system as it stands, it would just be an advanced-use function to give extra fine grained control. I'm sure you can appreciate that UE4 devs are starting to use the engine for things other than FPSes and there are going to be unforeseen situations that can't be addressed with collision filtering alone, particularly with MMOs (lots of actors of the same type) and complex actors made up of multiple primitive components that require unusual physics behaviour/interactions.

Let me throw out a couple of examples that will hopefully change your mind.

Imagine a physics-based train simulator game. A train actor is made up of a bunch of box carriages packed tightly together in a row (static mesh components simulating physics), and let's assume I'm not using the skeletal mesh component or physics joints for this, I'd like to do all the train movement myself in blueprint.

Now, lets say when a train turns a tight corner that the carriages inter-penetrate a little bit at the corners. For art reasons I can't change the geometry or carriage distances to prevent this. I can easily use the collision filtering system (as you suggested) to prevent carriages from blocking each other but still allow them block the world and other physics props in the scene. But now imagine I've placed two trains in the world. Now none of the carriages will collide with each other, even if TrainA and TrainB overlap! Okay, so let's make two collision channels, one for TrainA carriages, one for TrainB carriages, and they'll block each other, but not themselves. That works, but now I want to add 50 more trains to the scene. See the problem?

This is the reason UE4's SkeletalMeshComponent and PhysicsConstraints have added the ability to disable specific collision pairs internally. It would be great to have it as a more general engine feature that we can use and abuse from C++ or blueprint.

Another example would be a cannonball game for 32+ players. Let's say there's only two types of actors existing on a big flat plane: cannons, and cannonballs. Cannonballs are fired out of the cannons at other players' cannons. Unlike the ShooterGame example, we don't want to use overlaps for the cannonball projectile collision detection, we want them to use blocking collisions instead so when a cannonball hits someone else's cannon, it will bounce off it using physics (and deal damage on the hit event). When a cannonball is fired, we want it to spawn well inside the cannon geo/collision and shoot outwards so it looks good visually. So we need each cannonball to ignore collision with its owner cannon only, but collide with all other cannons. We could simply disable cannonball collision entirely for the first X seconds of its life, but that's a bit hacky - what if there's an enemy cannon right in front of it? Maybe we could set it to use overlapping collision until it's no longer overlapping with its owner cannon any more, then change it to use blocking collision after that, but that's a lot of work compared to just being able to turn off specific collision with its owner cannon.

Hopefully these examples have demonstrated the usefulness of a C++/blueprint function to arbitrarily disable collision between two FBodyInstances in the scene. UE4 already sort-of supports it internally via skeletal mesh components and physics constraints, I'd just love for it to be available elsewhere to make the lives of gameplay programmers a bit easier.

Thanks! Michael

more ▼

answered Jun 06 '15 at 03:22 AM

avatar image

sds-michael
156 9 15 23

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

Hi Michael,

I like the idea but I believe this could be easily achieved with collision channels. If you make a custom collision channel for your character and set them up to be a channel that gets blocked by normal things, but ignores others of it's own type, you could accomplish this with relative ease.

These two pages should be of some help if you wish to go down this path: https://docs.unrealengine.com/latest/INT/Engine/Physics/Collision/index.html https://www.unrealengine.com/blog/collision-filtering

Hope this helps!

Matthew Clark

more ▼

answered Jun 05 '15 at 03:00 PM

avatar image

Matthew J ♦♦ STAFF
31.8k 526 92 417

avatar image sds-michael Jun 06 '15 at 03:24 AM

Hi Matthew, please see my comment below - there was a character limit in the reply field, apologies! :)

(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