hai i`m yusuf, i just want to know how to knowing and remembering Destroyed GameObject Position ? what script should i make?
Something to get you started:
var rememberMe : GameObject;
var rememberMeLocation : Vector3;
function Start(){
rememberMe = GameObject.Find('nameofobject');
}
// Place right before the object is destroyed
rememberMeLocation = Vector3(rememberMe.transform.position.x,rememberMe.transform.position.y,rememberMe.transform.position.z);
Assign a variable to store the transform.position of the gameObject, then just before destroying update that var. e.g. (this is an example, not fully working code) :
var destroyingObj : GameObject; // or the reference to your gameObject being destroyed
var destroyedObjectPosition : Vector3; // variable to store position
// In the function
destroyedObjectPosition = destroyingObj.transform.position; // update var with object's position before destroying
Destroy ( destroyingObj ); // object is destroyed