Raycaster. Put on object in the direction of the block

The red block moves with the mouse. When the mouse approaches the black square, it is necessary to make the red square turn in the direction of the black square.
Tell me how this can be done? :woozy_face:

I create a black and a red square using the geometry artirubut - position

up the post :woozy_face:

Hi!
Any chance to provide a simplified example, that demonstrates the problem?