- Home /
Another camera drag script, can anyone figure out these errors?
So I am working on another camera drag script (for a top-down perspective game).
function Update (){
if(Input.GetMouseButtonDown(0)){
Scroll ();
}
}
var startcoords : Vector3;
function Scroll (){
for(Input.GetMouseButtonUp(0) = true){
startcoords = Input.mousePosition;
WaitForSeconds(0.5);
Transform.Translate(Input.mousePosition - startcoords);
}
}
I get two errors, Both asking for things that should not be there. I know that computers do not make mistakes, but this troubles me quite a bit.
-Thanks, javascript only
If you're wanting to "Drag", you'd want to use Get$$anonymous$$ouseButton, not Get$$anonymous$$ouseButtonDown, at least with the way you're calling Scroll();
Can you repost the code, I don't get what you are trying to say. Are you saying that I should simply replace Get$$anonymous$$ouseButtonDown with Get$$anonymous$$ouseButton? >I think I am over thinking this.
Answer by getyour411 · Aug 27, 2013 at 01:46 AM
I removed my previous answer after Googling what a camera drag script is, I think you want this
Your answer
![](https://koobas.hobune.stream/wayback/20220613113033im_/https://answers.unity.com/themes/thub/images/avi.jpg)