first post here so I hope this is an ok spot to post this issue.
I am casting rays and then (Trying to) drawing them. Nothing out of the ordinary here. I have gizmos on and can see all rays I cast on all gameobjects except for my player. At first I thought it was an issue with my script however, when I moved the script to just a basic capsule object I saw the rays fine. So it doesn’t appear to be an issue with the script(s). Then I moved the script to an enemy in my test scene and once again I saw the rays perfectly fine. I just can not see the rays on my actual player. As I said above I have gizmos and every check mark turned on. The script works perfectly I just can’t see the rays on my player character.
Thank you for the reply! So after doing some digging the issue is not what I thought. The rays are being shown, however I found them several units below my character which is why I thought they weren’t being shown. In short the rays are being shown, just not at the spot needed. Well below the origin spot.
In the future, please post code using Code tags, instead of pasting a screenshot of the code. And ideally edit your post to remove the screenshot and paste the code in Code tags.
I’d say the most likely reason it’s not behaving in certain cases if that you’re not getting the expected Raycast Hit. Try to debug that code, to see if the hit isn’t occurring. Or try Debug.Drawing the ray that you think you’re casting, to see of it’s in the right place.
Ahh ok will do. Haven’t posted code before so not sure even how to post it properly. I suppose its one of those code options in the tool bar though.
It is hitting. It’s hitting a platform my character is not on, a platform well below my character and not even on the surface of that platform. Its hitting within the well below platform.
Yes the green is in the right place. It was still being cast way below my character as the other rays were. I just ended up creating a new test object to use in the meantime. I am pretty sure I am redoing all the art and animations I had done (not many). I’ve already spent a day and a half on this issue and don’t really want to take more time to try and fix it when I am redoing the art anyway and the scripts work perfect on newly created objects. Not sure if this all ended up being a bug or something got messed up doing an update but no need to tear my hair out over it anymore haha
I appreciate your help! Hopefully no one else has this issue!