#Collisions
1 messages · Page 1 of 1 (latest)
thread here
OnTriggerEnter is invoked if a collider on the same object is involved in a collision where at least one collider is a trigger.
It's also invoked if the object has a Rigidbody and one of its children is involved in such a collision.
But let's step back from that for a moment.
Can you explain what your game needs to do?
Right
It spawns in 2 obstacles and the player moves around them while they come towards the player and behind the player there is a wall which is supposed to destroy said obstacles
Okay, so each obstacle could be destroyed separately?
you don't need to destroy them at exactly the same moment
they just need to be destroyed when they hit the wall
Yeah
Like attach a script to the obstacle being spawned?
Correct.
Okay Ill try that
Yeah I already called it Obstacle
How would I make it destroy itself?
Just Destroy();?
Destroy(gameObject) will destroy the game object the component is attached to.
Alright, the objects are being destroyed now I need them to respawn more objects after they're destroyed