I am having difficulty casting rays in my combat system. I have a transparent non-colidable part that surrounds the character to make them easier to hit. I want to be able to raycast from outside and inside of this part. If I go inside of the part my raycast doesn’t work.
Here is an illustration of what i’m trying to do (be able to hit the hitbox from outside of the hitbox, and the hitbox/player parts from inside of the hitbox)
IIRC, you can choose to blacklist certain parts from a raycast. If you set the hitbox of the player that is shooting to the blacklisted part, it should do what you want. Ill see if I can find information on blacklisting
So when you’re outside the player’s hitbox, you shoot the hitbox to hurt the player, but when you’re inside, you want to disable the hitbox? Why, may I ask? It’s a hitbox. How big is the hitbox?
You can try using magnitude to see if the Raycast origin is already inside of the hitbox, if it is, then you don’t need to raycast and you can just skip to dealing damage.