Detect collision from a another object,Detect collision from another script

In my scene i have a object which follows my cursor. When i click with the mouse button, this object gets placed on the ground. But some places, you can’t place it because something is in the way, and that is what im trying to detect.
The script is attached to the camera, and when i use OnCollisionEnter, it uses the cameras collider, and not the object.
Is it possible to make collision detection between two object, from a other object?,

At least I don’t know anyway to do that, but you can accomplish wanted effect in multiple ways.

It depends on what you are doing and how it plays out, but I would create empty object that has the script you currently have in camera. This empty object would follow cursor and the object you are placing is child of this empty object. OnCollisionEnter will trigger from child object colliders. When you click to place the object, just detach it from the empty parent object.

One other way to do this would be adding script to the object that follows cursor that has public bool which is set true OnCollisionEnter. When you pick up the object (or whatever happens in your game) you can set the script of that object to variable in the script that your Camera has. Then when you click you can just check if the boolean is true.

make sure both object have collider&rigidbody attached and one of them have a OnCollisionEnter method in script attached with it.