stop dragging through walls

GraybayGraybay Member Posts: 114
edited December 2011 in Working with GS (Mac)
Is there a way to keep collide rules in effect WHILE you drag an actor with your finger? While dragging I can make the actor go right through the floors and walls as it is.

Comments

  • POMPOM Member Posts: 2,599
    Check this out :
    http://gshelper.com/?p=377

    Roy.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    edited December 2011
    Tshirt has a great tutorial and demo on how to do this.
    http://gshelper.com/?p=377

    (You would replace the mouse position stuff with touch position.)

    EDIT: Ohh.. you gotta be fast around here! P-O-M beat me to it!
  • POMPOM Member Posts: 2,599
    Too slow RThurman ... too slow ;)

    Roy.
  • GhostShipAppsGhostShipApps Member Posts: 81
    edited December 2011
    I'm sure there should be a better system but what I do is create a integer that will be changed to 0 when touched and 1 when released.
    Then a rule that says when that integer is 1 nothing happen, but in the otherwise section I put the constrains.
    Last rule is when actor collides with a wall change attribute to 1.
    EDIT: I am even slower, there is the better method!
    http://gshelper.com/?p=377
  • GraybayGraybay Member Posts: 114
    edited December 2011
    LOL, this is even better than I expected, I was on GS helper trying to use MIN,MAX video to accommodate this need. I didn't notice this video though. Thank you guys! Is it possible to use a min max without the mouse position in it, for example you just want a box moving around by itself without leaving the screen, but without using walls. basically giving it a min,max position constraint which is always in effect.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    @P-O-M said:
    Too slow RThurman ... too slow ;)
    I blame it on old age. How about a little respect for your elders!

    RThurman
  • POMPOM Member Posts: 2,599
    Yeah you can do that ,
    you can tell your box that:
    if its X value is above 480 , constraint its x to 480
    if its X value is below 0 , constraint its x to 0
    if its Y value is above 320 , constraint its Y to 320
    if its Y value is below 0 , constraint its Y to 0

    I would however suggest simply make a border actor (unmovable) and place it around the scene
    then tell your boxes to collide with it .

    Cheers
    Roy.
  • POMPOM Member Posts: 2,599
    @RThurman
    You are right , I'm sorry , i didn't noticed i was so young ;)

    Roy.
  • GraybayGraybay Member Posts: 114
    Wow you guys are quick, this isn't a race now! Thanks, I will give this a shot. I just thought using another four actors would be heavier than having the position rules.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    @P-O-M said:
    You are right , I'm sorry , i didn't noticed i was so young ;)
    "But meanwhile it flees: time flees irretrievably, while we wander around, prisoners of our love of detail." (Virgil, 29BC)

    Tempus Fugit
    RThurman
  • CloudsClouds Member Posts: 1,599
    @P-O-M >> "I would however suggest simply make a border actor (unmovable) and place it around the scene
    then tell your boxes to collide with it ."

    This doesn't work, you can still drag an actor through walls, even with a collide behaviour.
Sign In or Register to comment.