|
Hey I'm making a Multiplayer FPS and now i have a problem with my Weapons-Pickup-Script. In my game you can pickup weapons kinda like in actual fps like call of duty. So when you pickup a weapon you throw your actual equiped gun on the floor. For this reason i would like to have an array of GameObjects. It should be public so that i can drag my PickupWeaponsmodels right in it from the editor. I searched for that a few times and find ArrayList but i didn't manage to get a public arraylist done where i can drag my models in. I don't even think thats possible. I also can't add my Models through tags to such an arraylist because the tags of the models are used elseways. Hope someone finds a way to solve my rather special question.
(comments are locked)
|
|
Use builtin arrays: C# or JS: Now you can access them in your script once you have them set. In the inspector you need to set the number of elements you need and then drag your game objects to each of your elements. Access is done the regular way arrays are accessed. E.g. Thank you very much i already tried the same thing before asking this question but it didn't work. Now it tried it again exactly like you described and it worked.
Apr 26 '12 at 05:19 PM
ExTheSea
glad to have helped mate.
Apr 26 '12 at 06:30 PM
GuyTidhar
(comments are locked)
|
