For one of my scripts, the camera needs to follow a path with several different waypoints per path. So if there are 10 paths, then it needs to choose which path to take, then follow the waypoints of that path. So to hold all that information, I need to use jagged arrays. Although it takes up memory (as I’ve heard), it saves about a hundred lines of code per script (without the jagged array I would need to write an if statement for each of the paths and more paths are added as the game goes along so I need to use arrays to resize them). How do I write jagged arrays. I’ve tried this:
public Transform[][] steps = new Transform[10][];
I’m assuming the first set of brackets is the number of arrays in the overall jagged array. But with that code, the variable doesn’t show up in the Inspector. Is that how its supposed to be, or am I writing something wrong? If it’s intended to be like that, how can I make it visible in the Inspector? I’ve already tried [ExecuteInEditMode]
. What am I doing wrong here? Thanks in advace.