How do I make something where if your camera looks at an object, a line of code runs?

Make sure you’re printing if result is nil, because that means there were no walls. If result is not nil, then there was a wall.

1 Like

I have prints on an if and else so no matter the result, it should print SOMETHING at least

You’re doing the raycast outside of the RenderStepped. Since the camera and orb positions change over time, you should be doing the raycast inside of RenderStepped

1 Like

oh lol


OH MY GOD IT WORKS, YOU’RE A LEGEND!

Why does it keep saying this sentence is unclear or something.


1 Like

This actually makes sense, thanks for this lesson!