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!)
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.
answered Mar 02 '18 at 04:39 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here