Search Unity

3rd person, camera and objects issue.

Discussion in 'Editor & General Support' started by devinrayolsen, Feb 27, 2011.

  1. devinrayolsen

    devinrayolsen

    Joined:
    Mar 8, 2010
    Posts:
    98
    Our game is a networked 3rd person shooter, and because of this we have a problem. When we move our player so that an object (other player, pole, tree etc...) gets between the player and the camera, our bullet impacts hit this object.

    Perfect example of this issue is in the bootcamp demo on the unity3d site, find a pole and move your player so the pole is between the player and the camera (inline with the crosshairs). You will see that when you try to shoot, your bullets end up hitting the pole that is behind the player.

    Has anyone ever found a solution to this? It can really make or break a 3rd person networked shooter when your teammates get killed because they got between your player and camera lol.
     
    Last edited: Feb 27, 2011
  2. devinrayolsen

    devinrayolsen

    Joined:
    Mar 8, 2010
    Posts:
    98
    For now, we have come up with a band aid solution that kinda blows:
    http://www.cssmunch.com

    Basically we cast a ray from camera to find impact point, if impact point is of a negative number along the z axis, we disable any bullets from flying. So if you happen to be in a heated battle with someone and a tree gets in the way, you stop shooting..

    Anyone have any other suggestions?