Is there a work around for the behaviour Move To?

Hello all

I was playing around, doing some advance stuff, and I notice the behaviour Move To doesn't work 2/10 times.
Is there an alternative to this? Without using interpolate, since interpolate can not be adjusted while in motion.

An actor moves down to position.y of 250 from 400 at a speed of 500.

Thanks

Comments

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    It's not move to it's how rules work. Wrap the move in a every 0 second timer don't check run to completion.
  • MillionairAppsMillionairApps Member Posts: 110
    It's not move to it's how rules work. Wrap the move in a every 0 second timer don't check run to completion.
    mmmm... That just made it worse. Cause now it just jumps to the end of the position instead of moving. It's reference a table cell value though, would that cause an issue?

    I remember reading that cause there are decimals, sometimes it doesn't get it exact and therefore so keeps going?

  • MillionairAppsMillionairApps Member Posts: 110
    Well, cheers for that Dave, it set me looking at another way, I just placed a rule in that says:

    When self.position.y is greater than position.needed then move to ....... Uncheck run to completion.

    So far nothing is going wrong.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited September 2013
    Yep there are a ton of ways to work with the move to. I use it all the time. You are right the decimals are an issue so I never use when = for position I use less than or greater than the number after or before depending on counting up or down the position. With the zero timer you need a cut off for the rule that's why you uncheck run to completion on the timer so when the rule cuts off it stops.
  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    edited September 2013
    As a side note...

    Normally interpolate is set to carry on until it has completed is journey

    You can however affect Interpolate when in motion with the correct setup... I'd need to dig out my old project to remind myself, but essentially if you link the 'time' to the 'distance between self position and the given destination' so the actor always travels at your prefered speed, then you can change an interpolate at any time by running the interpolate rule again. As well as set the destination to self position so it stops dead.

    This method would also allow collisions to work, as you can add a rule so that when the actor collides the interpolate is stopped.

    Whether this approach is any better I'm not so sure, but interesting to know that it can be done all the same.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited September 2013

    Carrying on @StormyStudio's side note, I did a small test a while back to show a way to stop an interpolated movement as well... found it in my pile somehow, hope it comes in useful for you (or anyone else... :-) )

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

  • MillionairAppsMillionairApps Member Posts: 110
    @StormyStudio and @gyroscope

    Cheers, I got testing and I sort of got it to work so it could be interfered. After looking at the demo I made adjustments and sort of combined it with some knowledge @Rthurman shared. Great stuff thanks :)

    Still trying to do some work on how to interpolate something, but if it goes past a certain speed, then the amount if time it takes increases so that it just doesn't become a blur moving so fast. But that's another story.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    I think many people abandoned the move to behavior because of it's quirks but once you learn how to trigger it properly it works great. I prefer it over interpolate as the movement is more fluid and also keeps collisions in place without jumping through hoops. Why bloat my code to force a behavior not designed for collisions to make them do so. Each behavior has it's use. I use interpolate for specific things and move to for specific things. All the AI for Puck It's computer player is move to. This is why the computer player can go around the bumpers on the table and chase the puck.
Sign In or Register to comment.