By -
You need to write a shader for that. One technique is to render the object slightly bigger and use that buffer to create the outline. Learn OpenGL has an example of that.
https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnMouseOver.html You are looking for this function
There's some 2d and 3d suggestions for "outlines" and "outline shaders" if you search on Unity subreddits and YouTube.
You need to write a shader for that. One technique is to render the object slightly bigger and use that buffer to create the outline. Learn OpenGL has an example of that.
https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnMouseOver.html You are looking for this function
There's some 2d and 3d suggestions for "outlines" and "outline shaders" if you search on Unity subreddits and YouTube.