So, I have been working on a raycast pistol, until now the best solution to simulating recoil I had was just offsetting the bullet hole a randomized amount from the mouse position, (ray uses same offset). But this causes some problems when offsetting more than 0.2 studs. Now, I was thinking of just creating the holes at the end of the ray, but I do not really know how to do that. I am not asking for code, just some guidance on what I might be able to use.

4 comments

2

The Raycast should return the Part and Position (where the Ray actively ends by contact) automatically from where the constructor is called. You can optionally declare this data within a variable if allocating it within the Raycast line.

0

Not only the part and position. It returns the Part, End Position, Surface Normal, and Material.

0

What about an animation?

0

No worries, already figured it out and made it