I’m making the effect of a power up. It’s supposed to take the position of a spawn point that is currently placed in the scene and give that same position but with a modified y-value to the prefab.
The Problem:
What it currently does is instantiate the prefab in the spawns exact position. I want it to be a little higher.
CODE:
public void Effect(){
//Activates the flag of the effect
PowUp_effect = true;
Transform spawn = GameObject.Find ("SpawnPoint" + Random.Range (0,8)).transform;
//Searches for the prefab in the assets
Object prefab = AssetDatabase.LoadAssetAtPath("Assets/Prefabs/Object.prefab", typeof(GameObject));
//Creates the instance with the coordinates
GameObject prefab_clone = (GameObject)Instantiate(prefab,spawn.position,spawn.rotation);
}
Please help!