Im trying to get Physical Material from a FHitResult reference when my projectile impacts. I have assigned a delegate to my movement component
TScriptDelegate<FWeakObjectPtr> StopDelegate; StopDelegate.BindUFunction(this, FName("OnHit")); MovementComp->OnProjectileStop.Add(StopDelegate);
The delegate is working properly and the function onHit receives only one FHitResult param:
void AProjectile::OnHit(const FHitResult& Hit)
Inside that function I’m trying to get the physic material from the FHitResult param like this:
UPhysicalMaterial* HitPhysMat = Hit.PhysMaterial.Get();
But HitPhysMat pointer is always null.
I’m pretty sure that the material which the projectile is impacting has a physic material assigned.