Defying gravity without unchecking "Movable"

TwilightHunterTwilightHunter Member Posts: 146
edited November -1 in Working with GS (Mac)
Hey fellas! I'm back with another question. I have a side scrolling game going here, I'm now fooling with the Joystick that I made from using the tutorial by CodeMonkey. Now here's the problem, the gravity in the room is set to... Let's say 500 or 1000 whatever, I put the joystick in there and it just falls like a regular actor, and when I uncheck Movable in the actor, It follows my clicks on the joystick base, But does not return to the center of the base when unclicked. How would I have the thumb button not fall from gravity without unchecking movable?
Hope that made sense!
Thanks in advance :P

Comments

  • TwilightHunterTwilightHunter Member Posts: 146
    Hrmm... I guess I could do what he does in the game file, which is having the Thumb Button be a non movable actor that changes into the movable actor when clicked, and when unclicked changes back into the unmovable one..? I dunno
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    nope. Instead of the move to when you are not controlling it, change its position back to that point with interpolate.
  • TwilightHunterTwilightHunter Member Posts: 146
    Oh hey! The big cheese himself :P
    That's what I have going on, but it's having a spazz attack about staying still. I'll mess around with it some more,
    Thanks!
  • TwilightHunterTwilightHunter Member Posts: 146
    Fixed it! I just said when SnapTo is true, constrain attribute self.Position.X (& Y) to BaseX and BaseY.
  • TwilightHunterTwilightHunter Member Posts: 146
    Alright never mind. Spoke too soon. When I release the thumb button, it constrains back to the center of the Base. But it won't move. I'm guessing because it's been constrained to the base or something? This is what it looks like:

    If SnapTo is false:
    Constrain attribute Self.Position.X to BaseX+min...(Not going to wright it)
    Constrain Attribute Self.Position.Y to BaseY+min... etc

    Otherwise:
    Constrain Attribute Self.Position.X to BaseX
    Constrain attribute Self.Position.Y to BaseY

    But after the first time you click it and then release. it never moves again.
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Do you have the rules to change the SnapTo back to false?
  • TwilightHunterTwilightHunter Member Posts: 146
    Ok, if I put the joystick in an empty room with the gravity at 1000. It works no matter how many times I press it. Must be something I'm doing in one of my other actors in the game.
  • TwilightHunterTwilightHunter Member Posts: 146
    Yeah I have that rule
  • TwilightHunterTwilightHunter Member Posts: 146
    Ok so instead of saying otherwise in the SnapTo rule, I changed it to 2 different rules, when Mouse is Down, SnapTo is false, when Mouse is Up, TouchTo is true.
    But when I change those to Touches Pressed and Touches Released it doesn't work.
  • TwilightHunterTwilightHunter Member Posts: 146
    *SnapTo not TouchTo
  • TwilightHunterTwilightHunter Member Posts: 146
    Alright so new issue, say I'm using multiple buttons on the screen. When I press anywhere on the screen, the joystick tries to constrain itself to my position, though it can't leave the base box. This is a problem because when I press another button on the screen, I see the little thumb button move to the side of the joystick base toward my finger. So basically no matter what the player does, the character is always going to end up facing right at the end.
Sign In or Register to comment.