Can someone give me an example of using a CollisionSegment between a camera and a moving target(3d person camera view). I’m using this to detect objects that get in the way of the camera and I couldn’t find a good example of CollisionSegment being used.
I note that your ray is a child of the camera, therefore it automatically inherits the camera’s position. So setting point A to camera.getPos() is adding the camera’s position to itself, and setting point B to dog.getPos() is just the wrong thing altogether.
Probably you intended your ray to be a child of render instead of the camera. Then you can use camera.getPos() and dog.getPos() in the way you are using them.