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. 

Increasing SphereCollision Radius doesn't "push away" adjacent physics objects.

It does displace the other physics objects, but does not push them (ie. the energy is converted into momentum away from the SphereCollision).

A real world example: Imagine if you had a deflated balloon on a table with ping-pong balls around it. When you inflate the balloon, it pushes the balls away. The faster you inflate, the faster they are pushed away and the more momentum they have as they roll away.

This was easy to set up in Unity, and UE uses the same PhysX engine so I'm wondering why it's not working. When I did it in Unity, I expanded the mesh (instead of using a SphereCollision) and it worked with the mesh's collision box.

I first tried that in UE, and it didn't work. I then tried using a Sphere Collision as well. As mentioned, it does DISPLACE the objects. That is to say, if I blow up a balloon really fast, the ping-pong balls move to the edge of the expanded balloon, but they don't roll beyond that. They simply move out and stop, with zero momentum.

(Addendum: I set the sphere collision by using "Set Sphere Radius" of the Sphere Collision in BluePrints, using controller input (trigger values) to set its size.)

I did try using a RadialForce as well, expanding that in an attempt to push away adjacent objects, but it also did not work.

I've also set up my physics to run at the highest resolution possible. Visuals aren't a concern but physics accuracy is, in this project.

I've tried everything to the point where I believe there is a bug in UE's implementation of PhysX 3.3. But I'd like to see if there are possible solutions before submitting it as a bug. Thanks in advance for any insight!

(Also, I want nothing more than to finish this project and do all of my projects in UE, in no way am I pumping the tires of Unity here, heh. It's great but I'm in love with Blueprints and UE's other aspects that I can't go to any other engine at this point!)

alt text

Product Version: UE 4.18
Tags:
more ▼

asked Mar 02 '18 at 03:34 PM in Using UE4

avatar image

nrXic
6 1 3

avatar image ThompsonN13 Mar 02 '18 at 03:58 PM

how are you implementing the expansion of the sphere?

avatar image nrXic Mar 03 '18 at 02:20 AM

Good question, I "Set Sphere Radius" of the Sphere Collision in BluePrints, using controller input (trigger values) to set its size.

Thanks and I'll update the question with that info.

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

1 answer: sort voted first

Expanding spheres inside a game engine doesn't have the logical effect you'd expect.

What the game engine does is that when it expands the sphere, it doesn't take into account any assets that might be "Pushed Away". It will continue to grow and "Overlap" actors and meshes rather than applying the expected effect.

Thankfully this can completed using a simple equation. When your growing sphere overlaps an actor, filter out any actors you'd like to physically push via Tags, and then use the "Unscaled Radius" of the sphere to move actors directly away from the radius equal to the amount the sphere grew on that tick.

Overlapped Actor > Actor has Correct tag > Move actor X Distance directly away from the sphere.

X = Amount the radius grew this tick.

This system is already automated inside of Ue4 when moving the location of actors, but not scaling. I imagine they will change this in future, but for now, you're better off utilizing this method, or one similar.

more ▼

answered Mar 02 '18 at 04:39 PM

avatar image

Raxs_Slayer
168 8 14 19

avatar image nrXic Mar 03 '18 at 02:26 AM

Sorry I am using odd terminology in my question (which is why I felt compelled to include a real life example) so I'll own up to this misunderstanding, but the Sphere does displace the objects away from itself, but those objects don't continue with the momentum generated.

It does "push away" up until the boundary of the expansion (I can see how my wording is a problem!), but doesn't push them further than that. Your solution looks to address the displacement of the other objects, which is in fact already does. It's just that those objects don't continue outwards as they do not retain any momentum from their displacement.

There may be a better way to word this, and I'm all ears! But yeah, it does push other objects to the X amount the sphere grew, but not beyond that.

And as I said, Unity handles all of this out of the box. The ballooning sphere pushes objects away and they retain their momentum, flying away from the ballooned sphere.

Edit: I've attached a little hand-animated example to show what I mean. Again, sorry for the confusion.

avatar image Raxs_Slayer Mar 03 '18 at 10:40 AM

Ahh I see. Glad they implemented that.

All I can think of is a method that I similar to my initial approach, just using the speed of the pushed objects to add momentum to them. Sadly I haven't had much experience with physics programming. So I can't declare that this is an optimized method. Literally utilizing an "Add force" node could work after collecting information on the velocity of the objects and initiating it when the sphere stops growing could work. But might not be very efficient.

Sorry for lack of a better solution.

avatar image nrXic Mar 05 '18 at 08:07 AM

It's a solution nonetheless. It will take some tweaking to ensure I get it right (determining the right amount of force will take looking at the expansion of the object in the last few frames) and you're right, it might be a bit more expensive than something that's out of the box in the engine.

At the very least, hopefully this gets Epic to look at a possible implementation issue (perhaps a bug?). I was hoping that I was implementing something wrong but it doesn't look to be the case.

(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