So I stated a project today and ran into a problem. I need to select a random static mesh from a list of static meshes, so to do this I decided to make an array. Problem is that when I try to add something to this array I get errors and I cant figure out what I am doing wrong.
here is my code
Sorry its mainly pseudo code. Basically, you are trying to put a string ("/Game/Meshes/Crate1.Crate1") into an array which is expecting a static mesh (UStaticMesh). You either need to change the storage type of the array () to something that allows a string ("") or you will have to load and create a UStaticMesh object and then put that into your array.
the first solution you gave has a red line under the . between Crates and Add that says, "No instance of overloaded function TArrayext matches the argument list.
And reguarding the second solution what is LoadSomeMesh used for?
Sorry if my question is simple, new to UE4
End goal is to create a simple game that will help me learn the engine.
So then what does a UStaticMesh look like then, i.e how is it referenced in code?
In the template I started in it creates them through a struct Crate1Mesh(TEXT("/Game/Meshes/Crate1.Crate1")) like so.
Why doesn’t it allow me to put this in the array?