Hello,
I ran into a little problem while doing my university project. I created the array of "ABall"s spawned in the level. Problem is that I don’t know how to access it and I cant’ find the answer in the documentation. I Want to access “type” variable and change the “bIsDestroyed”.
You are spawning your actors in your game mode (I guess you have set this GameModeto be the mode used in your level). To access your game mode you have to do something like:
Remember to check that GetWorld() is not null to avoid crashes. Another thing you have to take into account is that the GameMode is only available on the host instance, so in a server/client scenario clients won’t have an instance of it. If you are creating a network game you have to track your actors in something that you have in both sides like the AGameState which is replicated.
Well, i think you missunderstood my question. Everything up till this point works just fine. I just dont konow how to access alements in the array I created. For example I want to check the value of the “type” variable of a given ball spawned in the level.
I tried something like this: PlayingFiled[0].type
but it returned errors saying that PlayingFiled[0] has to be a class.