rdeioris / glTFRuntime-docs

Official Documentation for the glTFRuntime Unreal Engine Plugin
MIT License
100 stars 17 forks source link

Complex Collisions Don't Work #15

Closed IstyManame closed 5 months ago

IstyManame commented 5 months ago

On loading Static Mesh from gltf asset i check the "allowCPUaccess", "Build Complex Collision", and "Use Complex Collision As Simple" options. My Line Traces go straight through. If i also check the "Build Simple Collision" it starts to use this simple inaccurate collision even though "Use Complex Collision As Simple" is still enabled. Screenshots Attached. Thanks in advance image image

rdeioris commented 5 months ago

Hi, you need to set the Outer too (check https://github.com/rdeioris/glTFRuntime/blob/master/Source/glTFRuntime/Private/glTFRuntimeAssetActor.cpp#L175 for an example setting the staticmeshcomponent as the outer).

Note that if you need mobile support you need unreal 5.4 (previous versions do not support runtime complex collisions on android and ios)

IstyManame commented 5 months ago

Got it thanks, but is that c++ thing only? My knowledge of c++ is pretty basic and I'm not sure what part of this example to take and where to put it. In my project i use my actor with static mesh component and then load and set static mesh in it

IstyManame commented 5 months ago

Hi, you need to set the Outer too (check https://github.com/rdeioris/glTFRuntime/blob/master/Source/glTFRuntime/Private/glTFRuntimeAssetActor.cpp#L175 for an example setting the staticmeshcomponent as the outer).

Note that if you need mobile support you need unreal 5.4 (previous versions do not support runtime complex collisions on android and ios)

Should i create a new c++ actor, set the outer there, and set it as parent to my blueprint actor? There's no logic written inside this blueprint it's just a holder for static mesh coomponents

rdeioris commented 5 months ago

There is no need for using C++, you just need to assign the Outer field in the StaticMeshConfig structure in the blueprint node

IstyManame commented 5 months ago

Ahh ok thank you so much for your patience it works now!