Cursors and crosshairs

How would I make a crosshair or cursor, and lock the mouse cursor into the crosshair so its like the cross hair is the mouse? i want to make the crosshair interact with things, like activate objects when i click on them. Would i have to use raycasts?

To lock the mouse just use screen.lockCursor = true;

For a crosshair, I just used a GUI texture (Create > GUI Texture) and centered it. Just use whatever image you want for that.

As for activating objects, there’s probably a better way but I just use (with javascript, anyway) the function OnMouseOver and then an if statement checking whether there’s input on the left mouse button.

Hope that helps!
EDIT: to answer your comment (since I can’t put code in a comment):

function OnMouseOver () {
	if(Input.GetMouseDown(0)){
		//interaction
	}
}