Search Unity

Problem with raycasting

Discussion in 'Getting Started' started by ShinigamiUzi, Aug 28, 2018.

  1. ShinigamiUzi

    ShinigamiUzi

    Joined:
    Sep 5, 2017
    Posts:
    54
    Hi,
    I originate raycast from camera position going forward, a problem i'm facing is that, on certain angles, since i'm working with 3rd person view and camera is behind the player, the ray ends up hitting the actual player, I've tried having a transform at the front of the player object that looks at the end of the camera raycast, but
    doing that gives inacuurate aiming. I can't change the layer of the player.. since i'm working on networked game i have all the raycasting on the server, where all objects are on Player Layer.