Trying to nail the actor to the other actor ;-)

gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
edited November -1 in Working with GS (Mac)
Hi, I've an actor that slides in and out of screen, each time it does this it's over .8 of a second. I have another actor constrained to it (in fact there'll be up to 10 actors constrained to it). So with it constrained to the sliding actor, it slides in and out nicely, in tandem with this first actor; all well and good. But the centre points are constrained. But I'd want to move the x axis of the constrained actor(s) to be in different positions on the strip (sliding actor) (OK, it's an adventure game inventory...). I put in the Rules:

constrain actor self.Whateveritscalled.Position.x to (scene.Slideything.Position.x) + 39

Now it seems to lag when the slide comes in or goes out. Is there a neater and perhaps more elegant way of using the Constrain Attribute, so that the constrained actor sticks like glue to a moving actor, even though its moved off from the centre position, can any one tell me please?

Hope I've explained myself properly...

""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Comments

  • ValanValan Member, BASIC Posts: 410
    Have you tried interpolated?

    Perhaps you need to copy/pate the movement code rather than using constrain.

    Another way maybe to use move to behavior with a timer every 0.001. Move to the actors xy with an offset.

    Hope this helps

    Cheers
  • BarkBarkCoBarkBarkCo Member Posts: 1,400
    Alex, what is my dream day with the cast of "Twilight"?
  • ValanValan Member, BASIC Posts: 410
    BarkBarkCo said:
    Alex, what is my dream day with the cast of "Twilight"?

    : )
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi Valan, excellent, thanks, I'll use interpolation. As it happens, I've used that a fair bit in the past (and present) but strangely have never used Constrain; I thought it would be right for this! I guess it doesn't work with fast moving actors.

    Your second suggestion using a timer is interesting, I hadn't thought of that; I'll experiment with that as well.

    Thanks again! :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Sign In or Register to comment.