how to parent multiple objects? i have the code for just 2 weapons only, but then how about 2 or more objects?
try something like this; mind you, this is all psuedo-code.
javascript:
var NumberOfWeapons : int = 2; // Just fill in how many you have
var AllWeaponsMounted : boolean = false;
if(!AllWeaponsMounted)
{
if(int i = 0; i < NumberOfWeapons; ++i)
{
weaponObject.transform.parent = characterObject.transform;
if(i == NumberOfWeapons)
{
AllWeaponsMounted = true;
}
}
}
C#
int NumberOfWeapons = 2; // Just fill in how many you have
bool AllWeaponsMounted = false;
if(!AllWeaponsMounted)
{
if(int i = 0; i < NumberOfWeapons; ++i)
{
weaponObject.transform.parent = characterObject.transform;
if(i == NumberOfWeapons)
{
AllWeaponsMounted = true;
}
}
}