Hi, I’m working on a multiplayer game, and unfortunately while the rest of the gameplay is coming together fine, I’m having trouble with the multiplayer part.
I don’t really want to mess with the networking features, as that sounds a bit difficult (and I want to be able to play offline), so I was going to go with trying to create local multiplayer.
See, I want there to be a variable number of players, from 2-4. I want to instantiate the players based on that. So far so good (more or less).
Preferably, I want to use the same basic prefab and the same control scripts for all 4 players, but set each instance to accept input from a specific joystick. That’s the part I’m having trouble with. The way input is set up, I apparently have to set up separate axes for each joystick, and call them in the scripts, so I don’t see how one control script could work for all 4 controllers.
Any help would be much appreciated.
I also plan on attaching different components to each player depending on which character they choose, but I think I can figure that part out. I guess I could just forget about using the same control script and just make 4 separate ones, attaching the correct one at runtime. :\
EDIT: Nvmd, I think I figured it out. I just had to Take the base name of an input axis and add a variable. like "Fire + “variable” for Fire4.
Weird. I’ve struggled with this problem for a while and the moment I go to make a thread I realize what I was doing wrong. Sorry to waste your time.