how do you change the speed of an attribute constrain?

1UpGamestudio1UpGamestudio Member Posts: 213
edited November -1 in Working with GS (Mac)
Hello, I would like to create an actor who follows another actor, but at a slower speed than the first.
I put the string in the second actor: constrain attribute (self.position.X) to (game.AIActor1) but by doing so the second player moves as fast as the first.
How can I do?

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    constrain self position x to actor1.position.x-40

    change the 40 to whatever works for you
  • 1UpGamestudio1UpGamestudio Member Posts: 213
    No, doing so I will move the second actor to -40 pixels, but the speed is always that
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    sorry misunderstod

    actor 1 motion linear x-40 instead of its position

    you might have to throw a rule in to check if the actors motion your following is graeter then 0 so you dont end up going backwards
  • Rob2Rob2 Member Posts: 2,402
    divide velocity
  • 1UpGamestudio1UpGamestudio Member Posts: 213
    i don't understand!!!! please tell me more
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    make a real attribute called actorVelocity

    In the actor you want to follow constrain attribute actorVelocity to self motion linear velocity x

    in the actor you want to do the following have a rule when actorVelocity>0
    contstrain self motion linear velocity to actorVelocity-40

    or as rob said constrain self motion linear velocity to actorVelocity/2
  • 1UpGamestudio1UpGamestudio Member Posts: 213
    I could not do as you say JohnPapiomitis,
    you could create me a very basic tutorial?
Sign In or Register to comment.