Creating a snapping behavior

Fafnir312Fafnir312 Member Posts: 161
edited November -1 in Working with GS (Mac)
I'm moving an actor toward the player using acceleration. This works fine. However, when the actor comes within a certain distance from the player I want to apply massive drag to that actor effectively slowing it down to a crawl. But my rule isn't working. By all appearances it seems it should. Magnitude reads as it should. Maybe I'm missing something.

Here is my snapping rule:
http://i3.photobucket.com/albums/y58/MattVG/Game Stuff/snap_behavior.png

EDIT:
Even setting conditions that are obviously true doesn't work ie. snapDist = 2000 and setting the rule to be if snapDist > 0

EDIT:
Erm.. OK so I had another rule conflicting with this one. Though I still don't have it working, but I think I'm closer.

Comments

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Drag doesn't work inside a rule. Known issue.
    You could use an accelerate towards in the opposite direction.
  • Fafnir312Fafnir312 Member Posts: 161
    Oh, that stinks. Thank you for the info.

    EDIT:
    Since I wanted an incremental decrease in the velocity and getting the opposite angle wasn't possible (my math is lousy) I ended up just decreasing the linear X Y velocity as long as it's velocity was above that of the player.
Sign In or Register to comment.