what I'm I doing wrong?...see pic

sdsmith64sdsmith64 Member Posts: 221
edited November -1 in Working with GS (Mac)
ok...so i'm trying to get the actor to move with the finger of the player....

http://www.flickr.com/photos/61270786@N04/5577859854/sizes/l/

Comments

  • ShaneS429ShaneS429 Member Posts: 77
    Is that Yellow box actor the one that needs to follow your finger?

    Not 100% sure but I think
    Constrain Attribute: Self.Position X TO game.Mouse.Position.X
    Constrain Attribute: Self.Position Y TO game.Mouse.Position.Y

    Make sure you use Constrain and not Change as Constrain constantly updates.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    ShaneS429 said:
    Is that Yellow box actor the one that needs to follow your finger?

    Not 100% sure but I think
    Constrain Attribute: Self.Position X TO game.Mouse.Position.X
    Constrain Attribute: Self.Position Y TO game.Mouse.Position.Y

    Make sure you use Constrain and not Change as Constrain constantly updates.

    that is correct :)
  • sdsmith64sdsmith64 Member Posts: 221
    ShaneS429 said:
    Is that Yellow box actor the one that needs to follow your finger?

    Not 100% sure but I think
    Constrain Attribute: Self.Position X TO game.Mouse.Position.X
    Constrain Attribute: Self.Position Y TO game.Mouse.Position.Y

    Make sure you use Constrain and not Change as Constrain constantly updates.

    I did that as well....and when I touch the actor (yellow box)...it disappears!
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    not sure what your doing, but how shane said is how you do it.

    how big is your scene size?

    youll have to add a offset for the mouse position if you made it larger then what its normally set at
  • sdsmith64sdsmith64 Member Posts: 221
    here is a video of my problem ....any ideas?

  • ScootsScoots Member Posts: 507
    This might be obvious but just checking everything. You are making the changes to the actor in the scene and not only the prototype right?
  • ShaneS429ShaneS429 Member Posts: 77
    Ok I just created a blank project and set it up exactly how you had it.

    When Actor receives event - Touch - Pressed
    Constrain Attribute: Self.Position.X to Game.Mouse.Position.X
    Constrain Attribute: Self.Position.Y to Game.Mouse.Position.Y

    Mine works perfectly fine when I click on the square and it follows the mouse.

    The only thing I can think of is that in the video, you are editing the prototype of the actor. The code doesn't matter if it is in the prototype or the instance. Perhaps you forgot you have code in the instance, and not the prototype of actor 1 saying when it is pressed to go somewhere or destroy.

    That would be the only reason that box disappears. You must have code elsewhere telling that Actor 1 to either move, destroy, or turn alpha to 0.
  • magic101himagic101hi Member Posts: 713
    Here is a demo for you

    Download Link: http://dl.dropbox.com/u/4841281/Drag Demo.zip

    -Josh

    EDIT: Please tell me once you download so I can remove it from my public folder.
  • sdsmith64sdsmith64 Member Posts: 221
    Scoots said:
    This might be obvious but just checking everything. You are making the changes to the actor in the scene and not only the prototype right?

    well I was doing the rules in the prototype first ...and after what you said i checked the actor in the scene. both prototype and actor in the scene have the exact rules and it still disappears when i try to move it.
  • magic101himagic101hi Member Posts: 713
    sdsmith64 said:
    well I was doing the rules in the prototype first ...and after what you said i checked the actor in the scene. both prototype and actor in the scene have the exact rules and it still disappears when i try to move it.

    Please download the demo.

    -Josh
  • ScootsScoots Member Posts: 507
    should be: Devices not game.

    self.postitionX to devices.mouse.positionX
  • sdsmith64sdsmith64 Member Posts: 221

    Please download the demo.

    -Josh

    I did and yours works fine...and i set mine up to be like yours and it still does not work...
  • ShaneS429ShaneS429 Member Posts: 77
    Scoots said:
    should be: Devices not game.

    self.postitionX to devices.mouse.positionX

    When you go through devices it shows as game.mouse.position.X, there is no devices.mouse.position.x

    Your only other option would be to let one of us look at your project. I think we can agree you have to have code elsewhere effecting that actor, the code we gave and that is in your video should work.
  • sdsmith64sdsmith64 Member Posts: 221
    Scoots said:
    should be: Devices not game.

    self.postitionX to devices.mouse.positionX

    i tried to set it up as "devices" ...but it keeps putting in "game"
  • magic101himagic101hi Member Posts: 713
    Email me your game and I will take a look at it.

    Magic101hi(@)yahoo(.)com

    -Josh
  • magic101himagic101hi Member Posts: 713
    Did you fix it?

    -Josh
  • GLGAMESGLGAMES SingaporeMember Posts: 988
    sdsmith64 said:
    i tried to set it up as "devices" ...but it keeps putting in "game"

    Yes that is correct.
Sign In or Register to comment.