Home > other >  Please ignore the rays and role controller collision detection method
Please ignore the rays and role controller collision detection method

Time:09-30

I novice small white, recently to do a first person shooter game, the launch of the bullet, fired from among the camera a ray collision detection objects, and then instantiate the bullet from the muzzle toward the rays and the collision of some object, (wall)
To the role of a controller, because of the collision body features, ray from the camera, the first is the collision to the role of controller, lead to the bullet flew into his face, very headache, please ignore the ray collision detection method, and the role controller

CodePudding user response:

There will be this kind of situation?
Ray detection not to set up the layer?

In the bullet in the script to add public LayerMask mask;

Choose to detect layer

With the new, said the wrong if you don't mind,

CodePudding user response:

reference 1/f, no emotion response:
will have this kind of situation?
Ray detection not to set up the layer?

In the bullet in the script to add public LayerMask mask;

Choose to detect layer

With the new, said the wrong if you don't mind,

Tried, no effect, I changed idea, collision with rigid body and replace the role of controller, will that be solved,
  • Related