public GameObject launchpoint
; <------ this object is to be parent
public int channelID = 0;
public void T1A1press(){
if (channelID < 1) channelID = TNManager.lastChannelID;
TNManager.Instantiate(channelID, "T1A1go", "Prefabs/Projectiles/t1a1", false, launchpoint.transform.position, launchpoint.transform.rotation);
}
[RCC]
static GameObject T1A1go (GameObject prefab, Vector3 pos, Quaternion rot)
{
// Instantiate the prefab
GameObject go = prefab.Instantiate() as GameObject;
// Set the position and rotation based on the passed values
Transform t = go.transform;
t.position = pos;
t.rotation = rot;
go.GetComponent<Rigidbody> ().AddRelativeForce (Vector3.forward * 1000.0f);
return go;
}