Constraining something to what so I can where?

iDeveloperziDeveloperz Member Posts: 1,169
edited November -1 in Working with GS (Mac)
Im confused.

How do I constrain an integer to an actors position? So the integer changes as the actor changes?

Comments

  • iDeveloperziDeveloperz Member Posts: 1,169
    Doesn't matter.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Glad you sorted it, iDeveloperz; love the thread title! :-}
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    You'll need to create 2 attributes

    main_actor_x
    main_actor_y

    Then on your main actor;

    constrain attribute main_actor_x to self.positionX
    constrain attribute main_actor_y to self.positionY

    Then all other actors can access the main actors position by saying for example - move to main_actor_x and main_actor_y

    If that doesnt work then you may need to turn the constrain round so its;

    constrain attribute self.positionX to main_actor_x
    constrain attribute self.positionY to main_actor_y

    Cant remember what way round it is. lol.
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    Ah i see you sorted it :)
  • iDeveloperziDeveloperz Member Posts: 1,169
    Yeah. I never thought to do the X & Y :P

    I tried to do them both together. Thanks for the reply though.
Sign In or Register to comment.