Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

If you want create a ray at a certain angle all you need to be familiar with is cos and sin and apply it.

So speaking from a topdown view having the ray at an angle of 45 degrees would be simply X vector set to cos(45) and Y vector to sin(45).

I don't think you got me right. When the beam hits, I can calculate the position of the hit, but how can I calculate the slope of the surface that the beam hit?

Just to be clear: you want to get the yaw, pitch and roll of a hit face? What's the use case if I may ask?

Afaik you could use a bit of math and get yaw and pitch of the face from the normalized normal. However the normal from the ray hit is being used internally, it's not exposed via expressions or anything currently. 

Maybe such expressions could be useful.