江湖路
专注AJAX和Moss

获取SurfaceType的两种方法(我所知道的)

  1. EPhysicalSurface Surface = UPhysicalMaterial::DetermineSurfaceType(Hit.PhysMaterial.Get());
    

      

  2. EPhysicalSurface Surface =UGameplayStatics::GetSurfaceType(Hit);
    

      

第一种,在4.26版本中报如下错误:

无法解析的外部符号 "__declspec(dllimport) public: static enum EPhysicalSurface __cdecl UPhysicalMaterial::DetermineSurfaceType(class UPhysicalMaterial const *)" (__imp_?DetermineSurfaceType@UPhysicalMaterial@@SA?AW4EPhysicalSurface@@PEBV1@@Z)

不知道如何解决,记录一下;

已经找到解决办法,修改 ModuleRules文件,如下:

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore","PHYSICSCORE" });

  增加了:PHYSICSCORE

第二种,为替代方法,也能正常运行。

 

麻烦转载的,请注明出处,谢谢。

posted on 2021-01-20 11:24  wengnet  阅读(692)  评论(3编辑  收藏  举报