My hook not working, any opinions?

greedydadygreedydady Member Posts: 35
edited November -1 in Working with GS (Mac)
I am now making a hook function.
My hook can carry the actor from start point to end point. When it reach end point it release the actor than back to start point.
I am using the function which is when my actor collides with the hook ,it constrain x,y of the hook so that it follows the hook move to the end.
Problem comes out when they reach the end point.
I have no idea how to cancel the constrain attributes.
I tried destroy the hook and spawn one new at the end point, my actor just fly away.
Anyone can help me please?Thank you!

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    have a boolean attriubte called hookdestination and have it set to false,

    in the actor you want to be on the hoook, Have your rule when the actor collides with the hook AND hook destination =0 constrain attribute x and y to x and y of the hook. Then have a rule in the hook(wherever it is onscreen, ill use a x position of 400 for a example as the ending destination)

    when attribute self position x =400 change attribute hookdestination to true.

    that will cancel out the constraint for you

    cheers
  • greedydadygreedydady Member Posts: 35
    Thanks for helping.
    I have tried this too but my actor is still fly away, not work like normally dropping down when reach the end.
    Is it a bug or something?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    the whenever self position x=400 rule should be in the hook actor. You shoud should be changing the 400 number to the position it wants. This works so if your having trouble it might be anther rule itnerfearing.
  • greedydadygreedydady Member Posts: 35
    It works!
    THanks, you are amazing!
    Thank you!
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    greedydady said:
    It works!
    THanks, you are amazing!
    Thank you!

    glad you got it working mate
Sign In or Register to comment.