How can I instantiate an object relative to another object?
I also do not want the instantiated object to be made a child of the object it is instantiated relative to.
Here is my code:
using UnityEngine;
using System.Collections;
public class Spawning : MonoBehaviour {
public GameObject cubium;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if(1 == Random.Range(1, 200)){
Vector3 position = new Vector3(Random.Range(-100.0F, 100.0F), Random.Range(-100.0F, 100.0F), Random.Range(-100.0F, 100.0F));
GameObject clone;
clone = Instantiate(cubium, position, Quaternion.identity) as GameObject;
}
}
}