- Home /
How does one implement create-a-class?
As you can see from the comment below, I must not have explained myself in well enough terms for one particular user. Now please allow me to ask this answerable question in more simpler terms. Let's say we have two guns. A red gun and a blue gun. Both the red gun and the blue gun can have either a silencer or a grip.
I would like to create separate entities:
Guns: Red, Blue,
Goodies: Grip, Silencer,
Instead of separate prefabs:
Red Silenced, Red Grip, Blue Silenced, Blue Grip,
Because I will add a green gun and an orange gun later, I want it to look like this:
Guns: Red, Blue, Green, Orange,
Goodies: Grip, Silencer,
Instead of this:
Red Grip, Blue Grip, Green Grip, Orange Grip, Red Silencer, Blue Silencer, Green Silencer, Orange Silencer,
If you still do not understand my "create a class" example, you may remember playing a game like Call of Duty, Battlefield, Brink, Ghost Recon, Team Fortress, or Homefront.
If you honestly cannot help me, please refrain from being "that guy" and leaving an unnecessary comment followed by laughter. I am very willing to reply. I will be checking up on this several times a day.
Because I know that those on Unity Answers (and all programmers for that matter) do not usually like to give hand-outs, I will now share with you what I have been doing so far: Created a menu, where you may select the attributes of your player. On the menu is a button which allows the player to enter the multiplayer arena scene. In the multiplayer arena scene is a game object called "Spawner" which "uses" the data from the menu script to create a player prefab (player and gun are one prefab). This is the only way I know how to do it, but I know there is a better way.
PS. Bookmark or subscribe this page if you have the same problem. I will find out how to do it eventually and post it.
For those wondering how to get started, I am going to suggest searching how to make the gun pickup separate from the player.