Attach ray to camera

Hi!

I know there is the camera.getforwardray (not exact capitalization) and wondered if it could be used like this: https://www.babylonjs-playground.com/#KNE0O#84

To like detect what a ray has hit. I’m not sure how to do this, and my tries freeze the playground.

Any help would be a big thanks!

Givo

You mean like this? https://www.babylonjs-playground.com/#KNE0O#173

1 Like

I’ve seen this demo (before).

aren’t the boxes supposed to get bigger?

Looking at them doesn’t make them bigger.

Thanks for trying, though.

EDIT: NM, saw the code, realized it logs in the console. Thanks for the help!

1 Like