Hey guys,
I’m making this script where the platform will fall and I ultimately want it to be replaced by a prefab. I’ve been trying to assign a ready made prefab to a gameobject in code, but it doesn’t work, can anyone give me some pointers? I’ve tried using the unity reference sheet, but have nothing
using UnityEngine;
using System.Collections;
public class FallingPlatform : MonoBehaviour
{
public GameObject Prefab;
Void Awake()
{
Prefab = (GameObject)Resources.Load<GameObject> ("Prefab/FallingPlatform");
}
}