Hello,
I have been somewhat attempting the implementation of the following mathematical function without any luck.
function reflect(n,v)
local n1 = n.unit
local v1 = v.unit
return 2*(n1:Dot(-1*v1))*n1 + v1 -- From the 'Developer’s Journal' blog tutorial post.
end
Snippet of my code:
-- Tool is defined as well as the remote function.
local ray = Ray.new(tool.Effector.CFrame.p, (mouse.Hit.p - tool.Effector.CFrame.p).unit * 120)
local hit, position = game.Workspace:FindPartOnRay(ray, character)
func:InvokeServer(hit, tool.Effector.CFrame.p,position, charge.Value) -- Basically draws the ray through a remote function. I have FilteringEnabled set to true.
How would I use this when raycasting and what do the arguments 'n' and 'v' need?

4 comments
"Specular reflection" is an optics thing, probably not what you mean in this case. What exactly are you trying to do here?
Here is the wiki page on specular reflection. Hope you can help! http://en.wikipedia.org/wiki/Specular_reflection
You didn't answer: what are you trying to do? Why is specular reflection relevant?
Ah, sorry dude.. To put it simply, I am just trying to make a ray bounce of an object. Like if you shined a laser pen into a mirror, that sort of thing! The function is there, just don't know how to implement it into my code! :)