I am trying to make a tool that creates and moves a part in the direction of a surface's normal (i.e perpendicular) vector, determined by a mouseclick. I have the tool itself along with the target detection completed; however, I need to make the part that is created move outwards from whatever surface is clicked (if I click the bottom of a brick, the new part would move downwards from it, and if I clicked the side of a brick at a 45 degree angle, it would come straight out of that side, etc.)
How would I go about doing this? Thanks in advance.
If you already have the clicking down, then you need to get the mouse object passed in from the Equipped event in tool (First parameter), and make a new instance of a part facing the direction by setting the CFrame of the new part to CFrame.new(Tool.Handle.Position, Mouse.Hit.P) add a BodyVelocity to it, and set the velocity to Mouse.Hit.p, mess around with the speed by dividing / multiplying.
Mouse.Hit.p is the position of where you clicked.