My Raycast won't work at all ?? (C# Windows)

Hello,
It is my first time getting used to raycast and somehow my code doesn’t work.
I don’t get a log-entry, see a red rayline drawn during runtime or something else.

My tank has this cannon part marked in the picture from that origin a ray should cast forward. The cube infront of him has the tag “obstacle”.

What am i not getting?
Do i have to do something outside of the code to get it working?
I feel really stupid after 1.5 hours and alot of tutorials not getting my mistake.

Pls help.
:slight_smile:

ok for once i found one mistake. In my code the tag “obstacle” =/= the actuall tag “Obstacle”.
So the log entry worked :slight_smile:
Still i don’t see the ray drawn… :o
any ideas?