user16689250
user16689250

Reputation: 11

How can i make two game objects are pass through each other in Unity?

I made two game objects, player and enemy. I hope two game objects collision detect and they are pass through each other. Thus i put a check mark objects collider's 'is Trigger' and objects's 'rigid body'. So, i expected that objects are pass through each other. But, player and enemy crashed each other. Why player and enemy crash?

i want two objects pass through each other. help me please.

Upvotes: 0

Views: 2393

Answers (1)

R B
R B

Reputation: 61

A collider marked as a trigger should not cause physical collisions with an incoming Rigidbody (see here). Check and see if one of the player or any objects has a child with a collider that is not marked as a trigger.

Also note that a CharacterController component will be constrained by collisions, as mentioned in the documentation. CharacterControllers do not have a trigger option, so you will have to disable collisions through a different method. The most common methods are using Physics.IgnoreCollision or changing the layers of the objects and disabling collisions between layers in Edit -> Project Settings -> Physics. See here for more details: Layer-based collision detection and How to Ignore Collision between Objects.

Upvotes: 1

Related Questions