When called in C++ it’s nullptr, but is valid in BP. The mesh exists and is seen in the world.
Important:
What is even more strange - is the fact that this behaviour occurs randomly with around 10% chance every play in PIE (without recompiling), while other 90% plays are completely fine both in BP and C++.
there is a null-check already, but the point is that i have nothing to do with the null case because it’s completely illogical. the mesh exists in the world and i should be able to access it :[
It’s not necessary to cast child class to parent class in C++. a USkeletalMeshComponent inherits UMeshComponent so is a completely legal UMeshComponent variable.
Thanks for the detailed answer, however my code for that works too, perhaps yout have missed the important note: “the fact that this behaviour occurs randomly with around 10% chance every play in PIE (without recompiling), while other 90% plays are completely fine both in BP and C++.”
No problem, I didn’t miss that either (it’s just a weird thing that’s happening). Could you post your code like I did above so I can see if you missed anything?