Destructible Chunks have Screwed up Rotation

I’ve noticed odd behavior when working with destructible meshes from apex tools. When I start damaging the destructible and chunks start to fly around, several of the chunks behave as if their pivot point is offset from their center.

So in effect they are rotating around a point in space. It looks very unnatural and would never happen in physics unless there were a point gravity source that the chunk was orbiting. Any clues what’s up with this?

The apex lab simulator doesn’t exhibit the issue. I’m on 4.6.

Hi,

I’ll take a look at this, but in the mean time do you mind posting your modified settings for your DM along with any settings you have changed in the details panel when the DM is in your scene? It’s most helpful to be able to see the exact results you have rather than playing guess work on what I’m seeing on my end. :slight_smile:

Also, the PhysXLabs simulation aside, if you import a DM created with PhysXLabs are you seeing the same behavior or is this only with meshes created in UE4’s Fracture Editor?

One last thing, make sure to include the simplest setup that you see the results in. Usually default Fracture cell site count and seed work (ie. 25 and 0).

Thank you!

Tim

Hi Rama, That’s not necessarily true. Using the method you incorporated with using the Blueprint to scale it appeared to be using the originals collision and not updating that. However, if you just place a DM in your scene and scale it up you will still see accurate collision.

Tim

#Never Scale Destructible Meshes

You must have scaled your Destructible Mesh in the level itself! (the actor)

Never scale destructible meshes!

You must import the destructible mesh from Apex Physics lab with the correct scale

or

in the editor, you must export your static mesh, scale it in 3ds max or other art program, then re-import it with your final chosen scale

It is a known bug that scaling Destructible Meshes causes the result you are describing

I’ve reported it myself several times, including during the Beta

Most recent answerhub on this matter:

Rama

I look forward to your update on when we can scale at runtime!
:slight_smile:

All I can say for sure is the behavior that is described in this post matches my experience with runtime scaling as mentioned in my linked answerhub

The end result is the same, though I’m not sure how the original poster got to the same end result that I experienced :slight_smile:

Yes, I fully agree. Anything with run-time scaling can cause that issue. At the moment I don’t enough information to determine that to be the case. If it’s the same as in your tests I’ll add this to the bug report I submitted in your case so I can update both when this is fixed. :slight_smile:

Thanks for looking out though!

Tim

Tim, here is one of my test assets if that helps. To be clear, I’m only working with meshes created with PhysXLabs, I’m not touching the built-in fracture editor.

Probably the only thing out of the ordinary for this is that I’m using the asset defined support flag. If you look at Depth 1 chunks, the very center chunk is setup as a support chunk that isn’t damaged or fractured.

If it helps, my destructible mesh is not being scaled either at runtime or prior to it. Here is an [animated gif][1] of the behavior, watch the chunk to the top left of the players head.

https://dl.dropboxusercontent.com/u/7079101/ue4/answers/rotation.gif

Gravity is zero because we’re in space. I don’t modify gravity of the DM, the only way I interact with this DM is by calling TakeDamage on it, nothing else is touched.

do you have unusual gravity settings in your DefaultEngine.ini ?

What is your world gravity?

are you changing gravity of the destructible mesh before or after destruction?

Unfortunately, I’m not able to use your asset as it. It’s an FBX and on import is imported as a skeletal mesh and not an APB (destruction) asset. When you export from PhysXLabs you’ll need to use the export mesh option which will give you a APB file or if you’re using the Max/Maya plugin you’ll need to select the export option for APB in the drop down.

I created a rock mesh with 50 pieces and the center core as do not fracture/damage and a support depth of 1. I am not able to see anything like you’re describing with my mesh.

If you can export the asset in a APB format or demonstrate the issue in a video that may be helpful as well.

Tim

Sorry Tim, I don’t know what I was thinking (I actually tried to export the destructible from UE4 and it obviously didn’t work as intended). Here is the apb file. Please scroll down to see my comment on Rama’s answer for an animated gif of the problem.

Thank you for the APB file. That definitely helps. However, I am not seeing the results linked in your gif below. I tried setting this up with two ways for gravity and the results were the same with both.

  1. I disabled gravity for the rock apb itself.
  2. I disabled gravity for the entire project.

In both instances the chunks rotated correctly.

The only other thing I can think of that may be the problem may be in how you’ve set up your projectile vs what I have.

Here is a simple DM setup I have with a ray traced weapon that applies damage. Place your DM in this scene with no gravity and see if you’re seeing similar results as me.

If that looks correct, can you post your Weapon BP setup so I can see how you’re applying the damage to the DM and also can you try this in a new project and see if you’re seeing irregular results. This way we can start to narrow down what may be the root cause.

Thank you!

Tim

Thanks for looking into this Tim. Here is the C++ TwinStickShooter example modified enough to illustrate the exact problem I’m having. The primary modification is the series of laser functions in ApexBugPawn.cpp and primarily the UpdateLaserTick function where I perform the damage to the destructible.

Spacebar fires the laser in the example. The key to this seems to be enabling support chunks in the destructible options, disabling world support and having a chunk set as a support chunk.

I’ve ommitted the start content from this project since it was 99% of the size. You may need to drop it in the content folder.

Hi,

Just to give you a little bit of an update. I tried opening the project and building it with my internal 4.6 build but ran into some issues. I’m grabbing the 4.6 source build from GitHub to see if I can compile it that way. I’ll get back to you once I take a look and if I have any other questions.

I think I may have used the 4.6 Allegorithmic substance painter branch for that sample by accident, we recently switched to it. I was able to produce the same behavior in the 4.6 github branch.

Unfortunately, I’m still not able to reproduce this without non-uniformly scaling the mesh.

I’m also still not able to open the project you’ve provided. Though it more helpful and easier to track down if it’s reproduce in a new project without custom code to rule out factors that are not editor related.

Here is a couple of new videos showing you my results.

The first here is your mesh scaled uniformly to be 3 times bigger on the XYZ axis. The gravity is turned off and the DM is set to simulate physics

This is the second with the mesh non-uniformly scaled. X and Y = 3 and Z = 4.5. Here you’ll see the rotation issues.

While it’s OK to scale your mesh up or down uniformly (unless as Rama points out it’s being spawned in at runtime. there is a bug with that), scaling non-uniformly will skew the collision as seen in this video. Towards the end you can see it really evident on the small piece near the center left of the screen.

Thanks!

Tim

Tim, I am most definitely not scaling the destructible mesh at all, period and I am 100% sure of this. Can you tell me what error you are getting with the provided C++ project? You actually need to open the .sln and compile it to run it.

There isn’t any custom engine code required in this project, it’s just the C++ sample with enough code to repro my issue. Since I actually use C++ for all my UE4 projects, this is really the minimum viable sample that I can provide to you.

I tried compiling it before, but as I recall that didn’t work. This could be something on my end as I often don’t use VS or compile projects. I’ll give it another this upcoming work week and see if I can get it to compile. I’ll update you once I’ve done that.

Thanks Tim, if there’s anything I can provide to make this an easier task for you let me know. We’re 3 months into a fairly complex title, so when we hit bugs it can be quite difficult trying to yank out the smallest cross-section that will reproduce the bug and not confuse everyone with useless details.