- Home /
The problem is solved.
New Blender Model Instantiated wrong position
Hello guys, I am having some issues with an Instantiated belnder model being in the wrong position but the right rotation.
I have two models when clicking on the first model it is destroyed and replaced with another model, this works but the new model's position is wrong, it is floating in the air forward a little from the deleted model.
Both models are wrapped in a empty game object, both are positioned at 0 0 0 inside the empty
The script is very simple
using UnityEngine;
using System.Collections;
public class destro : MonoBehaviour {
public GameObject destroyed;
void OnMouseDown() {
Instantiate (destroyed, transform.position, transform.rotation);
Destroy (gameObject);
}
}
But like I said its position is wrong, I am not sure what is causing the issues
Check if the pivot you use is local or world. Should be same for both. Only thing I can think of.
It was something to do with Parent and Child, I did fix it in the end but unsure how! Somthing simple without a doubt as it always turns out to be, Thanks for the advice guys!
Are you instantiating a model or a prefab? A prefab would be better.