Interp only works on the way down!?

GraybayGraybay Member Posts: 114
edited March 2012 in Working with GS (Mac)
Example File: http://www.mediafire.com/?49wnwmv68tu95kc

I am having an issue with interpolate. In the example scene, the actor will change direction when you touch it. It is designed so that it will slow down via interpolate before heading in the opposite direction. I have used the exact same rule for both directions to interpolate linear velocity to zero. However the rule only works for the downward push, and not the upward. I have been messing with it for quite a while now, maybe someone here has an idea?

Thanks much!

Comments

  • POMPOM Member Posts: 2,599
    Don't use "Move to" behavior , its broken , instead , interpolate your actors X and Y position to the target position you want .

    Photobucket Roy
  • GraybayGraybay Member Posts: 114
    Interpolate doesn't let me stop the actor mid way. Also I can't have my character stand on an interpolated actor, it bugs it. I tried using "Move" instead and it behaves the same way as "Move to". Is "Move" also broken? Because I use it for many other items and it seems to be working great.

    Thanks for the insight P-O-M
  • POMPOM Member Posts: 2,599
    Wait , i just opened your project , and it works , what am I'm missing? ;) what is the problem ?
    What i see in the viewer is :
    white square goes up then stops on destination.
    I press it , it goes down , then stops on destination.
    I press again , it goes up the stops on destination.

    so.. what is the issue? i think i might misunderstood your question so can you be more specific?

    Photobucket Roy
  • GraybayGraybay Member Posts: 114
    edited March 2012
    Try to keep clicking the box before it reaches the destinations, imagine there is no destination. I want to change direction on touch, it is working fine, but when you click it is supposed to slow down via interpolate before changing direction. Normally the way I use these in my puzzle, they will never reach a destination, the player will keep changing the direction by touching the box before it reaches the end.
  • MotherHooseMotherHoose Member Posts: 2,456
    edited March 2012
    same here as @P-O-M got … works both ways


    @};- MH
  • MotherHooseMotherHoose Member Posts: 2,456
    edited March 2012

    oh, I see if you touch while it is moving … it will reverse direction

    one move rule … as only 1 condition triggers the behavior
    Rule: when
    Attribute: self.Up/Down = 0
    --the Up things
    Otherwise:
    --the Down things

    since the object is already in motion … I find the 0.2 second interpolation hard to spot … can't see if it working or not

    @};- MH
  • GraybayGraybay Member Posts: 114
    edited March 2012
    Thanks for pointing out the otherwise solution @MotherHoose. Quite smart. Problem is, the interpolate stops working completely once I place one or the other into the other's otherwise area. If you run it with the rules I included you should be able to see the interpolate working by looking at the velocity display I placed on the box. The smooth vs the abrupt direction change is quite noticeable to the eye also if the rules are working on your end.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    @Graybay
    In the first interpolate, set it to 80. In the second interpolate, set it to -80. (Keep duration at .2)

    Also, its best if you type the numbers in the input fields using the expression editor.

    Hope this helps!
    RThurman
  • GraybayGraybay Member Posts: 114
    @RThurman: You hit the nail right on the head, working as expected now.

    Thanks!
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Glad its working now!
    RThurman
Sign In or Register to comment.