Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

physics raycast not working? is this setup right?

Discussion in 'Visual Scripting' started by zeropointblack, Dec 22, 2020.

  1. zeropointblack

    zeropointblack

    Joined:
    Jun 8, 2020
    Posts:
    197
    hello friends.

    is this NOT right?

    bolt physics raycast 1.png

    I finally got this sorta working, but 2 things are wrong:

    1. the debug ray only shows about 2 feet out from player camera. not the full length. (and draw line, which is apparently much longer, only goes from camera to world origin no matter WHAT I do.)

    2. the returned ray distance, only shows anything other than 0 if it hits SOME objects, and those objects dont even have a collider half the time. but other objects for sure with colliders dont register at all. and no matter what layer mask i use or dont use.

    anything look off to you guys?

    thanks for reading.

    (btw im trying to dynamically adjust the cinemachine/physical camera's depth of field post effect... which may not even be the right way at all. i admit.)
     
  2. leeprobert

    leeprobert

    Joined:
    Feb 12, 2015
    Posts:
    49
    I know this is old but the issue is that the Raycast has either hot or not so you need an if, true or false logic to flow from true to the set focal length node.