Positioning gameObjects on a sphere

Hi everyone!
I have a sphere at the center of the screen,
I will instantiate gameObjects on the side.
The purpose is that I want the user to grab the object and place it on the sphere.
I need a method or a hint of how the grabbed gameObject will be positioned on the sphere!
I need the object to stand at the direction of the radius(like there’s gravity or someone standing on the globe).
Still no script about it, I need a hint of how the gameObject(grabbed) will detect the surface of the sphere and stand on the sphere after mouseDown!
Any hint would help

Hey, dude!

Seems to me what you want to do is get the collision point of a raycast. A raycast is like a line that you fire out of the camera–and when it hits something, you get information about that “RaycastHit”, as it is called (it’s a data object, with properties). I’m sure that studying this script reference and the site for RaycastHit will be easy, and then you just have to implement it. Once you’ve got that point–the point at which the raycast is hitting the sphere–all you have to do is instantiate an object at that point, and use script referenceTransform.LookAt()script reference to get it to face towards the position of the sphere (which will be its center). Then, finally, you’ll probably want to adjust the position of the object–maybe move it away from the sphere a little bit so it’s sticking out the proper amount. Otherwise it will spawn directly on the surface of the sphere. That’s the easiest part. Just add something to the instantiated object’s local y position, and you’re good to go! Hope this helps.

S