So I want a model spawn in front of the camera on the surface nearest in the direction the camera is facing. I just need help getting the CFrame of that position as I am going to use model:SetPrimaryPartCFrame(newCFrame) but I can't find a way to set newCFrame to the position I want. I've looked into Raycasting but can't see a way to find the end CFrame of the ray, only the part it's hit but this will only allow me to spawn the model at that part's center. I've also looked around for the source of Studio's insert part script but have been unable to find it, this does exactly what I want it to do, spawn directly in front on the camera, on the nearest surface and if there isn't a surface then spawn at the position 0, 0, 0 and move the camera to over there. I'm terrible at Camera Manipulation but have still even tried using the camera's CFrame and using the look vector of it to just try and spawn it a few studs in front but never achieved what it was meant to.
I hope you can help, I wish I still had my code so I could put it here so it looks like less of a request but I got frustrated and didn't save any of what I did yesterday. Any help is appreciated but if it is just help it's better as comments so people don't think this has already been answered.
