HTC Vive Controller Gun Rail Mount
If you're making a gun for Onward I would recommend Gwinntanamo's design instead.
https://youtu.be/u60bpVQV-AE <-- Original Gwinntanamo design
http://www.thingiverse.com/thing:1776502 <-- My 3D printed version
I'll leave this design here for academic purposes but I won't be updating it any further.
Credit to the previous designers without whom I would not have even started.
I remodeled the controller attachments so that they can't slip when you're pulling the gun back in to your shoulder. They easily slide off forwards.
Edit: A 30x30 length of wood is way too heavy.
I also used a 30mm x 30mm square length of wood to screw flat rail mounts on to so that I could print the rails without support.
Screw the gun rails on to a piece of wood with 18mm M3 wood screws.
Insert 2x 10mm x 2mm round rare earth magnets in each hole. Needs 8 magnets total. Use a hammer and small piece of wood to tap them in.
Attach to your controllers using a 25mm M3 Hex bolt and a nylock nut with washer.