I am trying to extend the UPhysicalMaterial class to assign a colour to the surface, for use in kicking up surface effects when driven upon. However, although the class is there in the code, it refuses to show itself in the Editor and therefore I can’t create any surfaces based upon it.
Anyone any ideas as to what glue I need to apply to make that magic happen?
Code sample below:
UCLASS(ClassGroup = Physics)
class GRIP_API UAdvancedPhysicalMaterial : public UPhysicalMaterial
{
GENERATED_UCLASS_BODY()
/** The colour of the surface */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Advanced)
FColor SurfaceColour;
};
I would also like this functionality. Right now it was easiest to tag some additional properties on to UPhysicalMaterial, but this means an engine rebuild every time we make a change. Deriving our own PhysicalMaterials would be much moar awesome!
Hi there.
I have my own PhysicalMaterial Class, but it is implemented in BP. I added a Footstep Sound and a Gun Bullet Behaviour by implementing my own Interfaces.
I create a Blueprint that has PhysicalMaterial as a Parent.
When you want to create a new Physical Material, you simply select your new class as a parent.
Do not use New Blueprint → NewPhysicalMaterialClass as a parent to create a Physical Material, but use Physics->PhysicalMaterial->NewPhysicalMaterialClass
Hey I’m trying to do the same to add a Sound Occlusion/Obstruction feature, I managed to extend the PhysicalMaterial class to add a float variable now I would want to create an instance in the Content browser to assign it to my meshes in the scene but I have to say I have no idea of how to create an instance of my class in the content browser
I created a blueprint class that inherits from my class MyPhysicalMaterial, but I want to assign it to a mesh Physical Material Override and I cannot cause it wants a PhysicalMaterial and apparently inheriting object do not work
Okay nevermind if you want to extend the UPhysicalMaterial class just click “Add New C++ Class” button add want you wish to add in your class, then right click in the content browser "Physics > Physical Material " it will then ask you from what class do you want your new material to inherit from then just select the class you created and finally you can assign your new Physical Material to your “Phys Material Override” static mesh property.