Okay here is my questions; firstly is it possible to have custom characters or weapons without unity pro? perhaps via scripting? My Team desires to work on a fps short game featuring the custom weapons, similar too army of two, also could that apply to characters as well?
Yes. no scripting required. If they are FBX files, you can just drag them from explorer into the Unity Project pane. Scripting will be required to make the weapons fire though.
I’m not sure where you got the idea that you would require unity Pro to do any of this stuff, but anyway…
If you want to be able to switch between various weapons, there are several well-known methods for doing this. Search this site, I’m sure you’ll come up with at least 10 similar problems.
For customisable weapons, you could do someting like this
[System.Serializable]
public class Weapon
{
public float damage;
public float recoil;
public bool hasScope;
public bool hasLamp;
public bool hasProjectile;
public GameObject projectilePrefab;
public Renderer weaponRenderer;
}
Make all the ‘weaponRenderer’ fields be renderers, children of the main camera, that are the correct objects in the correct positions.
Then, in your firing script, have somthing like this:
public Weapon shotgun;
public Weapon rifle;
public Weapon bfg;
Weapon curWeapon;
void Awake()
{
curWeapon = shotgun;
}
void FireGun()
{
Target.takeDamage(curWeapon.damage);
// do other things based on 'curWeapon.whatever'
}
void ChangeWeapon(Weapon nextGun)
{
curWeapon.weaponRenderer.enabled = false;
curWeapon = nextGun;
curWeapon.weaponRenderer.enabled = true;
}
void Update()
{
if(Input.GetKeyDown(KeyCode.Alpha1))
{
ChangeWeapon(shotgun);
}
if(Input.GetKeyDown(KeyCode.Alpha2))
{
ChangeWeapon(rifle);
}
if(Input.GetKeyDown(KeyCode.Alpha3))
{
ChangeWeapon(bfg);
}
}
Now, you can add as much functionality as you like to the ‘Weapon’ class, but this should get you started with basic weapon switching and customisation. Remember that you can modify the weapons at runtime- if your shotgun gets an addon that increases its damage and decreases its recoil, you can use
shotgun.damage = shotgun.damage + damageModAmount;
shotgun.recoil = shotgun.recoil + recoilModAmount;
Same for adding scopes etc:
void RaiseScope(bool up)
{
if(!curWeapon.hasScope)
{
return;
}
Camera.main.fieldOfView = up?35:80;
}
Remember to reset the scope before you change weapons! It’s as simple as adding the line
RaiseScope(false);
immediately before you switch guns.