newbie question

jimp74jimp74 Member Posts: 5
edited June 2012 in Working with GS (Mac)
hi I have an element that can be draged in the scene set up as follows
actor receives event -touch- is pressed

constrain* attribute: self.position.Y = game.touches 1.Y
otherwise* Move to position 170 150 relative to scene.

this works when its the only scene but if I add a menu scene and then have a button change scene to the one with this action
the actor just sinks of the bottum of screen.

is there something obvious I can try.

cheers

Jim

Best Answer

  • gyroscopegyroscope I am here.Posts: 6,598
    Accepted Answer
    I see, I thought you were on iPad size. :-)

    If its drifting off screen then you either must have another movement-type behaviour affecting it somewhere, or the scene gravity is not at zero...

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Answers

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited June 2012

    @jimp74

    Hi Jim

    My guess is the actor is moving to 170/150 as you asked it too without a touch pressed...

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • jimp74jimp74 Member Posts: 5
    edited June 2012
    Hmmn, but when the scene is used in isolation and if you drag the actor off screen those cordinates bring the actor back to where it starts ?

    P.S. thanks again Gyroscope.
  • lukey5227lukey5227 Member Posts: 111
    My guess is that somehow the touch position is being delayed so where touch is pressed, it goes to the previous touch?
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited June 2012

    You're welcome. :-)

    Yes, from what I can gather from your Rules you've put, when there is no touch, the actor is moving to 170,150 (as asked for in the rule in your Otherwise section). So as soon as you enter the scene, and there's no touch happening, your actor will move to its new position.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • jimp74jimp74 Member Posts: 5
    Ok, but the position I'm asking the actor to go to 170,150 is close to the middle of an iphone screen based on 0,0 being bottom left. my troublesome actor is drifting off screen and out of sight?

    in fact when there is no touch the actor going to 170,150 is what I was hoping would happen.
    either 170,150 isn't on the screen or something else is effecting my actors position...

    I'm not at home so can't check but I'm wondering now if I have gravity or something going on.

    cheers guys :)
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    The move to does tend to drift I notice this in an AI I'm building and it seems the condition doesn't fire continually. Put the move to in a rule in otherwise and then add the condition if attribute self.postion x doesn't = 170 and make the same for Y then put the move to in a timer set to every 0seconds run to completion checked. This will keep it firing until it reached the position. This also may be a viewer issue as I'll be testing an adhoc with a similar situation.
  • jimp74jimp74 Member Posts: 5
    Thanks for all your help,
    I'll post back later when I've had a chance to check things out.

    I think I'm going to like it here.
  • jimp74jimp74 Member Posts: 5
    The move to does tend to drift I notice this in an AI I'm building and it seems the condition doesn't fire continually. Put the move to in a rule in otherwise and then add the condition if attribute self.postion x doesn't = 170 and make the same for Y then put the move to in a timer set to every 0seconds run to completion checked. This will keep it firing until it reached the position. This also may be a viewer issue as I'll be testing an adhoc with a similar situation.
    Thank you FryingBaconStudios,

    I put the constrain attributes in a rule and the move attributes nested in a timer inside otherwise.

    fixed my issue.

    Thanks again
Sign In or Register to comment.