- Home /
Camera movement based on OnMouseDrag()
Is it possible to move the camera around using the OnMouseDrag() behavior?
I've seen some examples on how to drag GameObjects around with this behavior, but could it also work for a camera?
It is for an RTS game I'm working on.
I have GameObjects labelled "ground" with a collider. I was thinking maybe to translate the information coming from raycasting these objects back to the camera, but I can't wrap my head around it how that could solve it. Any ideas?
Your answer
![](https://koobas.hobune.stream/wayback/20220612073708im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Why is 2d camera not smooth at 30 FPS 0 Answers
Camera Is glitching when I move 1 Answer
Move the camera in 2D when target reaches bounds. Is there a better way? 0 Answers
Trying to recreate the doodlejump camera c# 1 Answer
How to rotate camera diagonally over players shoulder while still facing towards players direction 0 Answers