- Home /
Two objects in same space disappearing
I'm a beginner to Unity, and creating a 3D multiplayer game where the same object triggers different results based on which player collides with it.
To do this, I've actually just created two separate, identical objects and put them in the exact same space on the level. The problem I'm having is that this is causing both objects to disappear in Play mode. I do not currently have any scripts attached to either object.
Apologies if this is a basic fix that I'm missing - I've searched for a solution but haven't been able to find anything.
Answer by Chris_Dlala · May 28, 2014 at 09:09 PM
There are a number of ways you can achieve your desired behaviour. One fairly quick way (assuming that you are using colliders / triggers) is to add layers for your objects in the layers manager. Then you can define which layers should collide with which other layers in the physics matrix - see link.
For example you could have layers like RedPowerup, BluePowerup, RedPlayer and BluePlayer. In the matrix allow RedPlayer to collide with BluePlayer and RedPowerup layers, and the BluePlayer can collide with BluePowerup and RedPlayer layers - assuming that the players can interact with each other.
Other ways involve more of a coding approach. I hope that helps =)
No problem, glad I could help! Could you please select my answer so this question is registered answered. Thanks, =)
Your answer
Follow this Question
Related Questions
How do I go about destroying empty game objects on collision? 1 Answer
Best way to manage a collision between a few different objects? 1 Answer
Collision detection of certain ojects 1 Answer
How to make a specific object not collide with a specific collider - 2D 1 Answer
Preventing objects from shoved 0 Answers