x


Swapping between Characters/Multiplayer

Hey every1,Im making a 2players/hotseat game,there are 10 characters in total and you are able to swap between them as long as the other player isn't using the one you choose,each character is a different prefab with his own model,statistics. My question is,What is the best way to handle this? An array? I tried a public GameObject array,then dropping the prefabs into the slots,then instatiating,but when I try to swap characters its turning on/off the collider/Renderer of the prefabs no the ones in game. Any insight? Thanks In advanced.

more ▼

asked Jun 03 '12 at 12:36 PM

Mikael1987 gravatar image

Mikael1987
16 1 3 5

Yeh Well I did forget to mention that there will be character progression,and also need to keep track of their health and such,so I cant just destrou and then instantiate again(as all statistics will reset).

Jun 03 '12 at 01:56 PM Mikael1987
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

I'd just Instantiate the prefab you wanna show and then Destroy it when another character is selected. No reason to keep it around and try to juggle renderers and colliders.

more ▼

answered Jun 03 '12 at 01:45 PM

Mortoc gravatar image

Mortoc
915 2 7 14

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1363
x683
x60
x10

asked: Jun 03 '12 at 12:36 PM

Seen: 384 times

Last Updated: Jun 03 '12 at 01:56 PM