Developer Notes

By Design. I can see that this is confusing, but it is expected at the moment, and I'm not sure of a good way to fix it. The physical material is stored on the collision body, so when you change the PhysicalMaterial on the MID, the body needs to be updated. Unfortunately we don't have a mapping of all bodies using a particular MID, and updating all of them could be very expensive. The best workaround is probably to call SetMaterial again on the afftected component, which will update the collision info. Or you could manually query the material and then physical material on the object, rather than using info from the HitInfo.

Description

Line Traces are not correctly returning the Physical Material Info when that information is changed at runtime via a Override Physical Material or a Set Physical Material via a Dynamic Material Instance.

Also Reproduced in 4.11 Preview 1 and Dev-Rendering CL-2822902

Steps to Reproduce

*Quick Reproduction - PIE Attached Project, Press K to change MID Physical Material, Press L to run a check based on call to MID directly, Press J to run a check based on Line Trace*

  1. Create a New Blank Project with No Starter Content
  2. Create a New Material Called M_Test with a Vector Parameter called Color plugged into Base Color
  3. Create a New Physical Material called Phys_Mat_A
  4. Assign Phys_Mat_A to M_Test
  5. Create a New Physical Material called Phys_Mat_B with Friction set to 2.5
  6. Create a New Actor Blueprint called BP_TraceTest
  7. Add a Cube to BP_TraceTest
  8. In the Cube Coimponent's Detail Pane under Collision, set Return Material on Move to true
  9. In the Class Defaults under Input, set Auto Receive Input to Player 0
  10. Recreate the Construction Script and Event Graph shown in the attached picture BP.jpg
  11. PIE
  12. Press L
  13. Press K
  14. Press J
  15. Press L

RESULTS: When running a check calling the Physical Material directly, the results are always correct, but when running a line trace the Physical Material returned is always incorrect.

EXPECTED: Physical Material returned is always correct.

Have Comments or More Details?

Head over to the existingAnswerHub thread and let us know what's up.

0
Login to Vote

By Design
ComponentPhysics
Affects Versions4.10.14.114.12
CreatedJan 11, 2016
ResolvedJan 12, 2016
UpdatedApr 27, 2018