How to make rays bounce not reflect

  1. What do you want to achieve? Making rays bounce, I know how to reflect it but not how to make it bounce, I’m trying to make a sound system.

  2. What is the issue? I don’t know the formula or calculations to do so.

  3. What solutions have you tried so far? Only found ray reflections, Tried looking.

1 Like

By bounce do you mean straight back to the player? Like a sonar type system?
If so when you fire the first ray get the location it hit (just like reflecting) then fire the next ray back at the original source.

1 Like

“bounce” meaning to redirect the sound waves after hitting a surface, similar to how light bounces off a mirror. Something like that, But not really like a sonar system where it will bounce back to the player.

I’m trying to make ray traced echo. “If so when you fire the first ray get the location it hit (just like reflecting) then fire the next ray back at the original source.”, But it doesn’t create results like ray traced echo.

local function reflectVector(vector: Vector3, normal: Vector3)
	return vector -2 * vector:Dot(normal) * normal -- r = v - 2n(v ⋅ n) * n
end

Thank you it worked, Scottifly’s idea did work but it doesn’t really give me the result I was looking for.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.