PhysicsMaterial attached to Static Mesh not getting recognized

Hi! I am using different surface types and PhysicalMaterials to play different hit effects and deal varying amount of damage. It is working fine with the character I created as a target, but not with the default floor which is present in the scene.



When using a BreakPoint in code, the Hit.PhysMaterial is returning DefaultPhisicsMaterial for this floor but proper values for the character.

Have you tried logging out what you’re hitting to see if it is indeed the wall you are hitting?

Yes

Then I’m not sure, I could take a look at it if you want?

You can do that by using the following link?

https://gdev.tv/projectupload

Please use File > Package Project > Zip Up Project within Unreal as this will ensure only required files are zipped up and things like the Binaries are excluded.

I have zipped up and uploaded the project…

Huh, strange. Apparently this only works if you don’t use complex collision for the trace?

https://answers.unrealengine.com/questions/543189/view.html

QueryParams.bTraceComplex = false;	//Checks collision on triangle level, thus returning detailed info

Making this false fixed it.


As a side note

Hit.GetActor()->GetFName().ToString()

Can get rid of F and ToString

Hit.GetActor()->GetName()

So it seems. But it worked with that set to true for TargetCharacter which I placed in the scene.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms