- Home /
Question by
palaktiwari_21 · Dec 02, 2020 at 01:19 PM ·
destroygameobject
how can i destroy an object on press of space when its x position is equal to or greater than the other object,how can i destroy a object when its x position is equal or greater to the character's x position.
how can i destroy an object on press of space when its x position is equal to or greater than the other object
Comment
if(object.transform.position.x > character.transform.position.x){
Destroy(object);
}
Do you mean like this? ^
Your answer
Follow this Question
Related Questions
OnTriggerEnter only Destroy other.gameObject.name "?" 2 Answers
Destroy object destroys affects other objects? 0 Answers
taking velocity of object a to apply to an instantiated shattered object. 1 Answer
Help | Want Audio Clip to play back as 2D, Volume at 1, Looped after destroying game object 0 Answers
How to destroy an object if it already exist in a scene 2 Answers