Is it possible to make a sound play when a player is walking on a specific material. For instance, cling with metal floors or a low pat for soft ground? I know it has to be possible, anyone know where a tutorial can be found to do this?
Announcement
Collapse
No announcement yet.
Sounds for ground materials?
Collapse
X
-
This is what I'm aware of :
For static meshes you can do this :
Open up the mesh's properties, expand the "Collision" section, the "CollisionComponent", the expand "Physics". You will see the "PhysMaterialOverride" field.
Now go to your Generic Browser and look for the "PhysicalMaterials" group, which is greyed out. Load the entire package. Select the appropriate material (make sure that the "Phsical Material" resource type is checked).
Now go back to your properties and select that button with the green arrow at the right of the PhysMaterialOverride field.
For the terrain, for some reason, the ground sound can't be changed. At least until patch 1.3.
For CSG brushes, I don't think you can. But if there is a way, I also want to know how
Good luck.
-
I thought it was based on the Physical Material associated with the material applied to the mesh/surface. Every material can have its own Physical Material set in its properties and the Pawn code uses the GetMaterialBelowFeet() function which does a trace to determine what type of material the Pawn is standing on and plays the footstep sound based on this. You can see where the type of material is set in the Physical Material by expanding the PhysicalMaterialProperty and looking at the value of the MaterialType property. Although, it is possible the PhysicalMaterial applied to the PhysicalMaterialOverride does override the material's PhysicalMaterial.
The UTPawnSoundGroup has an array of footstep sounds associated with the various material types and a default:
Code:FootstepSounds(0)=(MaterialType="Stone",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_StoneCue') FootstepSounds(1)=(MaterialType="Dirt",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_DirtCue') FootstepSounds(2)=(MaterialType="Energy",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_EnergyCue') FootstepSounds(3)=(MaterialType="Flesh_Human",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_FleshCue') FootstepSounds(4)=(MaterialType="Foliage",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_FoliageCue') FootstepSounds(5)=(MaterialType="Glass",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_GlassPlateCue') FootstepSounds(6)=(MaterialType="Water",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_WaterDeepCue') FootstepSounds(7)=(MaterialType="ShallowWater",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_WaterShallowCue') FootstepSounds(8)=(MaterialType="Metal",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_MetalCue') FootstepSounds(9)=(MaterialType="Snow",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_SnowCue') FootstepSounds(10)=(MaterialType="Wood",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_WoodCue') DefaultFootstepSound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_DefaultCue'
Jumping Sounds:
Code:JumpingSounds(0)=(MaterialType="Stone",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_StoneJumpCue') JumpingSounds(1)=(MaterialType="Dirt",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_DirtJumpCue') JumpingSounds(2)=(MaterialType="Energy",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_EnergyJumpCue') JumpingSounds(3)=(MaterialType="Flesh_Human",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_FleshJumpCue') JumpingSounds(4)=(MaterialType="Foliage",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_FoliageJumpCue') JumpingSounds(5)=(MaterialType="Glass",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_GlassPlateJumpCue') JumpingSounds(6)=(MaterialType="GlassBroken",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_GlassBrokenJumpCue') JumpingSounds(7)=(MaterialType="Grass",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_GrassJumpCue') JumpingSounds(8)=(MaterialType="Metal",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_MetalJumpCue') JumpingSounds(9)=(MaterialType="Mud",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_MudJumpCue') JumpingSounds(10)=(MaterialType="Metal",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_MetalJumpCue') JumpingSounds(11)=(MaterialType="Snow",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_SnowJumpCue') JumpingSounds(12)=(MaterialType="Tile",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_TileJumpCue') JumpingSounds(13)=(MaterialType="Water",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_WaterDeepJumpCue') JumpingSounds(14)=(MaterialType="ShallowWater",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_WaterShallowJumpCue') JumpingSounds(15)=(MaterialType="Wood",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_WoodJumpCue')
Code:LandingSounds(0)=(MaterialType="Stone",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_StoneLandCue') LandingSounds(1)=(MaterialType="Dirt",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_DirtLandCue') LandingSounds(2)=(MaterialType="Energy",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_EnergyLandCue') LandingSounds(3)=(MaterialType="Flesh_Human",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_FleshLandCue') LandingSounds(4)=(MaterialType="Foliage",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_FoliageLandCue') LandingSounds(5)=(MaterialType="Glass",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_GlassPlateLandCue') LandingSounds(6)=(MaterialType="GlassBroken",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_GlassBrokenLandCue') LandingSounds(7)=(MaterialType="Grass",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_GrassLandCue') LandingSounds(8)=(MaterialType="Metal",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_MetalLandCue') LandingSounds(9)=(MaterialType="Mud",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_MudLandCue') LandingSounds(10)=(MaterialType="Metal",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_MetalLandCue') LandingSounds(11)=(MaterialType="Snow",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_SnowLandCue') LandingSounds(12)=(MaterialType="Tile",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_TileLandCue') LandingSounds(13)=(MaterialType="Water",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_WaterDeepLandCue') LandingSounds(14)=(MaterialType="ShallowWater",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_WaterShallowLandCue') LandingSounds(15)=(MaterialType="Wood",Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_WoodLandCue') DefaultLandingSound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_DirtLandCue'
Comment
-
Originally posted by ffejnosliw View PostI thought it was based on the Physical Material associated with the material applied to the mesh/surface.
If you look at the bottom of the window, you will see it's properties and the first field is PhysMaterial. The only why I know how to change it is to select all of the nodes (except the Preview Materials), then create a new material in your map's package, past all the nodes, and reconnect them back to the Preview Material node (all of the other connections will be remembered.
Then you should be able to set your own PhysMaterial with out it affecting the stock one. Be sure to use your new material in the map as it will be lost when you do a full rebuild/save (can never remember which one).
I don't know a lot about Materials, but at least I know this much?
Comment
-
Originally posted by Idiot View Postare you applying the material to a static mesh or csg? I cant seem to get the physicalmaterial to work. All i'm doing is choosing the physicalmaterial to apply to the material, and then finally applying the material to csg, but sounds remain the same. Is there something else I need to do?
Comment
-
Originally posted by Idiot View PostI'm trying for CSG/BSP, still no worky. I'm basically just trying it out to see how to implement it, but when walking, jumping, or shooting the surface, only the default sound plays. Do I need to do something in code? (i'm not a coder, so i hope that isnt the case).
Comment
-
Originally posted by Idiot View Postjust created my own material and applied the "metal" physical material to it.
Comment
-
Originally posted by Odedge View PostHmm, I just tried it and it worked fine for me. Can you post a screenshot of the properties when you click the PreviewMaterial node (far left)? If not, you can send me the map (odedge at odedge dot com).
I try to learn from what's already in the engine, but all of them have a "physicalmaterialproperty" which i can only assume refers to code that makes it work. Unfortunately, I'm not a coder and hope i dont have to do any to make my own physical materials.
Comment
Comment