Question about the position of a prepab

I wrote a script. it should establish a object at the position of intersectionpoint of my mouse looking and the ground . However the computer can’t decide the center of my object (prefab) . the new object is far from the intersection point . How can I fix this problem.
Thank you very much .

Place the prefab back in a scene. Change the pivot display mode to pivot instead of center. (This is a button by the scene control buttons). That should show the actual pivot of the object.

You can the prefab a child of an empty object and then move it so it is centered how you wish under the parent. This should mean when you instantiate it and set it’s position it is where you want it.

I would give visual examples but I am writing this on my phone. Comment if there are any more problems.