why does the camera track my mouse weird? (examples included)
Hi there,
NOTE: links below were updated, didn't realize pointing dropbox links to a project opened it like a folder
Ok so i've been working on this problem where i want to have the mouse move an object around a large space (using camera).
The assumed approach here would be that i would constrain an object to follow the touch/mouse position
This is a bare bones example of the problem.. is there some formula that would compensate for the increasing mouse position or something? I'm working hard to understand a lot of these various functions, but none of them that i understand seem like a solution. https://www.dropbox.com/s/npfb75u3xz9wnki/Camera Trouble 5 (stripped down).gameproj.zip
the 2nd solution is closest to what i'm trying to get working.. the closest thing i could find to allowing the mouse to track better (but not accurately still) is adding *2 by the constrain attributes "to" mouse position.. here is the link to this slight
https://www.dropbox.com/s/amjtpcfn3eays6t/Camera Trouble 6 (with *2 modifier).gameproj.zip
If i can figure out this behavior it will be a huge leap in me getting this project moving forward. I just can't figure out why it is behaving like it is.. i would imagine that the graphic would stay attached to the mouse and therefor the camera would follow up to the edge..
Thanks!
Caleb
NOTE: links below were updated, didn't realize pointing dropbox links to a project opened it like a folder
Ok so i've been working on this problem where i want to have the mouse move an object around a large space (using camera).
The assumed approach here would be that i would constrain an object to follow the touch/mouse position
This is a bare bones example of the problem.. is there some formula that would compensate for the increasing mouse position or something? I'm working hard to understand a lot of these various functions, but none of them that i understand seem like a solution. https://www.dropbox.com/s/npfb75u3xz9wnki/Camera Trouble 5 (stripped down).gameproj.zip
the 2nd solution is closest to what i'm trying to get working.. the closest thing i could find to allowing the mouse to track better (but not accurately still) is adding *2 by the constrain attributes "to" mouse position.. here is the link to this slight
https://www.dropbox.com/s/amjtpcfn3eays6t/Camera Trouble 6 (with *2 modifier).gameproj.zip
If i can figure out this behavior it will be a huge leap in me getting this project moving forward. I just can't figure out why it is behaving like it is.. i would imagine that the graphic would stay attached to the mouse and therefor the camera would follow up to the edge..
Thanks!
Caleb
Best Answers
-
Yovanny369 Posts: 105
see if this works for you (This is the good!)
https://www.dropbox.com/sh/9gqiviyqfbjs7xz/Me9jyf_C3_
Answers
In camera mode i have the tracking area set to 0,0 so its super tight. please take a look at this project and maybe you'll find something else i left out. its a really simple project focusing on this one thing:
https://www.dropbox.com/s/amjtpcfn3eays6t/Camera Trouble 6 (with *2 modifier).gameproj.zip
I think you'll see i already did it exactly as you said which seemed like the right way to do it, but notice how the graphic doesn't track the mouse 100%..
this only happens when i make the stage bigger than the screens size.. the constraints work fine when it is specifically 480x320 but make the stage 960x640 and this is when things start to get weird.
you'll notice one slight modification to what you suggested in the constrains of the object that i did.. which actually makes it act better, but still not ideal:
game.Mouse.Position.Y *2 and game.Mouse.Position.X *2
removing the *2 results in a worse effect.. the mouse still doesn't track.. it gets more and more off track as you move your mouse to the right.. but keep it in the lower left corner and the object tracks perfect.
Thanks!
Caleb
https://www.dropbox.com/sh/r8os9yjvhgaj15v/7hAQr3DKVi
Thanks!
Caleb