why does the camera track my mouse weird? (examples included)

part12studiospart12studios Member Posts: 620
edited August 2012 in Working with GS (Mac)
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

Best Answers

Answers

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    You need to constrain an object to the mouse positions and then shrink your tracking area down to something smaller than the scene. Then put a control camera behavior in the actor being constrained to the mouse.
  • part12studiospart12studios Member Posts: 620
    @tenrdrmer thanks so much for responding!

    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
  • part12studiospart12studios Member Posts: 620
    edited August 2012
    @eduard0369 that's it! Is it that you unlocked the actor? I got some feedback from GS helpdesk that suggested i try that.. i hadn't gotten to it just yet but it looks like thats what you did... wait.. what is that extender thing? what is the logic behind that? thanks! because part of my question this is also how to make the sliding not quite so fast..

    Thanks!
    Caleb
  • part12studiospart12studios Member Posts: 620
    no i didn't mean the name so much.. but yea i think i see what's going on with the extender actor. i forget to explore the possibilities of unlocked actors. thanks!
Sign In or Register to comment.