Mouse Aim- Weapons

My class mates and I are making a 2.5D Side Scrolling game. We need the gun to follow with the mouse (Aim). I can't find a script to get this off the ground. If anyone knows how to do this or can teach me, it would be great thanks.

Im guessing you have a player controller in your scene, all you do is open up your Player Controller (using the arrows) and drag your weapon into the Main Camera so its a child -- this will allow your weapon to follow your camera. Which is what you want.

My initial thoughts focus around using a large hidden plane and the raycast functions of unity. Since your game is 2.5d, its a little difficult to know exactly how you want the aim to work. The ".5" could include concepts of appearing to aim off axis as an example. But since your camera is likely still a perspective based camera, you probably want a plane that constantly updates to the view frustrum at the appropriate "depth" of the character, and to then do raycasts from the screen space position of the mouse, into the scene from the camera. Collide against the plane. Once you have that intersection, a simple vector subtraction and normalization will give you a vector with which to point the gun in 3d.