Mimic MOVE TO without using MOVE TO behaviour!!!

PeeCeePeeCee Member Posts: 107
edited February 2012 in Working with GS (Mac)
Hi.

I like the MOVE TO (when it works) behaviour in that i can tell an actor to move to x y but i want
to do this another way perhaps using motion linear or change velocity however im having problem
tell the actor to stop at an x y pos.

what am i missing.

any help would be appreciated.
cheers

Comments

  • FallacyStudiosFallacyStudios Member Posts: 970
    @PeeCee

    It sounds like you should be using Move To. It's difficult to determine what you should be doing without some more info. What are the controls for moving the character? Are you using D-Pad/Joystick or Touch screen to move? Is the actor to move on it's own?

    You can accomplish it with motion linear. You will just have to set it up so that when the actor reaches the X,Y you want that motion linear is set to 0. How exactly is Move To not working the way you want?
  • ozboybrianozboybrian PRO Posts: 2,102
    edited February 2012
    Easy...
    Change attribute . Self.LinearVelocity X to 100
    When self.position X ≥ 300 change attribute self.LinearVelocity X to 0

    That's it. It's what I do.
  • PeeCeePeeCee Member Posts: 107
    thanks guys. and yes its just an actor that i call to slide in to show some tips and then fly off again.
    i like the slide in slide out thing about it.
    FallacyStudios - MOVE TO behaviour is a broken one in that sometimes it works by stopping at desitination and sometimes flies off screen (its been a long outstanding bug from GS).

    Ozboybrian - i will try your way and see how it goes.

    many thanks gents for your immediate replies. :)

  • FallacyStudiosFallacyStudios Member Posts: 970
    @PeeCee

    Ya I rarely use Move To so I haven't seen that error myself. Ya if you do what oz said you should get what you are looking for.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Use interpolate
  • App SurgeApp Surge Member Posts: 651
    edited February 2012
    Interpolate the actor's x and y coordinates to where you want it to go.

    EDIT: John beat me to it ;)
  • ozboybrianozboybrian PRO Posts: 2,102
    I would of suggested interpolate but that's only if it doesn't collide with anything or have anything else happening while interpolating because interpolation stops everything else happening to that actor from my experience. So I use velocity.
  • calvin9403calvin9403 Member Posts: 3,186
    you can use another interpolate to overrides the other one
  • simo103simo103 Member, PRO Posts: 1,331
    edited February 2012
    @PeeCee ... hands down do as John said (use Interpolate). That behaviour is built for things like slide in menus, tips etc ... why ... well those actors don't need to collide or interact with other items in the scene so you can turn movable off in physics, that saves resources on the engine for other items in your game. Also you have ease in, ease out or ease both so you can choose a nice effect to get that slide in and out nice and smooth. So Interpolate for the win!
Sign In or Register to comment.