How would I offset a 3D raycast so it's always directly in front of the player in 3D

Hello, I’m trying to add slope detection to my FPS game using the 3D raycast extension, but I can’t for the life of me figure out how to offset the raycast so it’s always directly infront of the player no matter what way they are facing. The rotation doesn’t seem to affect anything and I don’t know why. The image attached is my code for the raycast, any help is appreciated!

image

I managed to figure it out, just with a different method of getting it to work. Instead of offsetting where the raycast was coming from, I just changed the elevation angle. This crudely drawn image I just made explains it better

1 Like