I was wondering if it’s possible to access a vector array in the material editor. What i’m trying to do is get the location of multiple NPCs to drive the positions of sphere masks. Right now I have it working fine with one NPC, calling the location vector from a Parameter collection.
Every time you add a player, the shader has to perform the mask more than once. Since you already have one vector in the MPC, you can go ahead and setup multiple vectors in the MPC and just route them all to multiple masks in the material. You shouldn’t have too many passes, though (10+), or else the material complexity will grow out of hand.
I’ve been looking around and yeah, the problem is getting a foreachloop for the sphere masks. Well for my game, we only ever see 2 enemies max at once. Maybe I can set up 2 variables in the MPC and 2 sphere masks in the editor. And then depending on the index of each actor on screen (and within distance), I assign their velocities to the MPC hence driving the 2 spehre masks. Wonder if that is even possible. Im new to blueprints too haha
You can track more than one variable in an MPC and use Blueprints to do so. However you wish to do so is up to you, but the solution should be only one MPC with all the vectors in it, and your Blueprint should update both indices properly.