Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- public class Planet : MonoBehaviour {
- // Use this for initialization
- void Start () {
- createDatMoon();
- }
- // Update is called once per frame
- void Update () {
- }
- void createDatMoon()
- {
- GameObject prefab = (GameObject)Resources.Load("Prefabs/Moon");
- Vector3 pos = new Vector3(0, 0, 2);
- var currentPlanet = Instantiate(prefab, pos, Quaternion.identity);
- currentPlanet.transform.parent = gameObject.transform;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement