Hi. I faced with very strange and specific issue.
I have an c++ actor with destructible component. I loaded destrictible mesh asset using FContructionHelpers, and spawn this actor in c++ UObject. Everything goes fine while i’m in editor on Standalone game. But when i package, event with additional direcdtories to cook my destructible asset, it spawns, but it has no collision, physics as well, and doesn’t work as destructible.
I thought the problem is in FContructionHelpers. I decided to create Blueprint actor, which is exactly the same. If i spawn it in blueprint, everything is OK. But as soon as i spawn this actor from c++ code, it doesn’t work in packaged game.
I thought maybe it’s a problem in my project. I’ve decided to create Blueprint empty project. I created there BP actor with destructoible component and it works. But when i create this actor in cpp code, it doesn’t work. Again.
I event created in my UObject cpp class “Spawn” function, which only takes UClass to spawn (because i can’t spawn my actor from blueprints, cus UObject can’t spawn, and program architecture makes me use UObject). And if i use this “Spawn” function, it works in editor, but it STILL doesn’t work in packaged game. But in my cpp code i have no any reference to destructible components, except this UClass pointer. But this is UClass pointer, why it doesn’t work? If i spawn the same actor in Blueprints, it works.
As i understood, Apex Destruction library works in another way if the program has any references to Destructible in cpp code, not only in Blueprints. But, as i said, i change everything to use only UClass pointer, and it still doesn’t work.
To clarify, i have to use UObject, derived from cpp UObject. I’m pretty sure it would work if i could spawn my actor from Blueprints as well, without any (even UClass pointer) references to cpp code.
So, any ideas?
Can we see the cpp class from your test and the Bp code too please
So, i have virtual SpellCast function. I need my specific “SpellMeteor” spawns the actor “BP_Meteor” So, in SpellCast_Imeplementation it just calls SpawnMeteor, which is BlueprintNativeEvent i’ve overrided. (A bit horrible, but i just tested why i can’t use destructible in cpp).
So, if don’t spawn this actor from cpp and just place this actor in the world it works fine. But if i use this cpp function it doesn’t work. And this actor, what i’ve placed in the world, doesn’t work anymore too. It’s very strange.
Is the packaged game for mobile? Because Apex doesn’t seem to work mobile
Nope, it’s for Windows x64. Seems like any code in cpp, that connected to Apex, crashes all dependencies even in BP. Just like he knows that i use Apex somehow in cpp and builds it in another way
But the only one connection is UClass pointer xd. If i broke this connection BP_Meteor (placed in world) is going to work fine…
Have you tried making your destructible class in CPP?
I have a base destructible implementation in CPP for our character.
Yep, i have. As i mentioned, i’ve created an empty project with cpp class with destructible component. And it didn’t work in packaged game. I’m sure I’m wrong, but I don’t know where exactly. I’ll give u cpp code in few minutes
So, here I go. In the editor: Left side - CPP class with destructible component, right side - just Destructible Mesh placed in world. Everything is fine.
And in the packaged game: Cpp class even didn’t appear, and destructible mesh doesn’t work. Just like it has no collision
Are you including the apex stuff in your packaging?
What do you mean? How should I do that?
I have this issue as well still.
It’s not in CPP mind you - but spawning a destructible mesh in BP and adding an impulse works completely fine in engine, but just won’t do the impulse and fracture through a packaged project.