Drag stops actor?

chrisalchrisal Member Posts: 74
edited November -1 in Working with GS (Mac)
Hi all,

OK as the title suggests I would like to know if drag should eventually stop an actor. I have just left my game for an hour or so in the game viewer and all my actors ran off the screen. Can thins be solved or is this a problem with GS?

Many thanks

Comments

  • RHRH Member Posts: 1,079
    The only reason that they should run off the screen is if you make them!
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Drag slows actors down unless you have behaviors like Move, Move To, Accelerate that continually tell the actor to keep moving.
  • chrisalchrisal Member Posts: 74
    So I would have to stop the actor with a rule if I want the actor to completeley stop?

    i.e. If self.motion.x <0.2 and self.motion.y<0.2 = stop actor
  • chrisalchrisal Member Posts: 74
    I have been thinking, and would like to know the difference between drag and friction? Do they accomplish the same results?
  • millerbrother1millerbrother1 Member Posts: 108
    From what I can tell Drag is similar to Friction and they can both work together. Drag is probably best used to slow your character down in a situation where you need him to. For example: You could create a rule that changes the Drag Physics of your character when you press the D key. In this example Pressing D applies the "brakes" (so to speak) to your character and will stop him from moving at his fullest potential. Make sense? Drag is easier to manage in this way. It's a dampener. Gravity has no effect on drag directly.

    Friction on the other hand works differently - it is a relationship between objects. When Gravity is on it causes friction between your actor and the ground. The lower the number in your actor's "friction" the more "ice like" the surface will be to him.

    Anyone else have a better explanation?
  • ORBZORBZ Member Posts: 1,304
    drag is that feeling you feel when you run your hand through the water really fast... the resistance force.

    friction is what you feel when you rub sandpaper on your face

    to detect and come to a full stop:

    speed = magnitude(linearVelocity.X, linearyVelocity.Y)
    rule when speed < 2
    move 0
Sign In or Register to comment.