Detect Physical Material + Error in viewport | Footstep sounds
Hi guys, today I want to implement a more advanced First Person Character and added head bobbing. Now I wanted to add some sound to my character with sound variation. I've found a good video tutorial and everything worked out, but now I have problems with detecting the Phys Materials and some errors, when I end the viewport playback.
First of all I want to show you my blueprint: https://blueprintue.com/blueprint/i7cjl-gx/
The default sound works, but the others won't ... and I dont get a printed string. My thought was, something is missing to detect the Physical Material. In the Project Settings I set my Physical Surface, I created new Physical Materials and assigned them to the Standart Materials. I also assigned the Surface Type to the Phyiscal Material. This is the setup I need, right?
And this isn't my only problem. After end the Play mode, I get the following Error Message:
Blueprint Runtime Error: Accessed None trying to read property CallFunc_BreakHitResult_PhysMat from function: 'ExecuteUbergraph_FPS_Controller' from node: Switch on EPhysicalSurface in graph: EventGraph in object: FPS_Controller with description: Accessed None trying to read property CallFunc_BreakHitResult_PhysMat
In case the full blueprint is necessary: https://blueprintue.com/blueprint/xeublpt3/
To be honest - I understand there is a connection missing, but I dont know how to fix it.
Thanks for your help :)
asked Mar 04 '18 at 02:00 PM in Blueprint Scripting
It seems to me like your line trace goes 20 units up, not down. If so, you're not getting a hit at all.
Also, 20 units might be too short anyway.
I'm also curious which trace channel you're using, but again I'm pretty sure that in one way or another, your trace isn't even hit anything.
I think that might explain your error message too (invalid phys mat in hit result).
Have your blueprint report the hit boolean to you and see what it's saying.
Did you remember to apply your physical materials to the landscape layer files generated in the Landscape Paint tab?
answered Jul 27 '18 at 11:56 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here