GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to check when an Interpolating actor stops moving?

MarkOnTheIronMarkOnTheIron Posts: 1,447Member
edited November -1 in Tech Support
As the title says I need to check when an actor that use interpolate stops moving.

I can't use a rule that check when self.Motion Linear is 0 because interpolating actor (I don't know why) have always set it to 0 so it doesn't work.

Comments

  • gyroscopegyroscope I am here.Posts: 6,577Member, Sous Chef, PRO
    Hi Mark, i guess one way would be to use a boolean attribute. Set it to false before the interpolation happens, and then with a timer, after the same amount of seconds that the Interpolate Behaviour runs, set it to true. Then you can use the attribute as you want, knowing the actor has stopped moving: When attribute IntStop is true, then...

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

  • scitunesscitunes Posts: 4,047Member, Sous Chef
    Just check the location. You have to interpolate to a certain location. just check when it gets there.
  • MarkOnTheIronMarkOnTheIron Posts: 1,447Member
    @gyroscope: Thanks! While waiting for an answer I came up with the same idea and it's working really well (and 100% of the time).

    @scitunes: That was the first thing I tried when I encountered the problem, I don't know why but it doesn't work.
  • scitunesscitunes Posts: 4,047Member, Sous Chef
    MarkOnTheIron said:
    @gyroscope: Thanks! While waiting for an answer I came up with the same idea and it's working really well (and 100% of the time).

    @scitunes: That was the first thing I tried when I encountered the problem, I don't know why but it doesn't work.

    I always try to avoid timers when possible. I think the problem is that it may only exactly equal the x or y coordinant for an instant and it's not long enough. So you could try this if the timer starts causing a framrate issue:

    Lets say you are interpolating to an x of 0 and you are starting at 240. You could check when X ≤ 1

    But if the viewer is giving you good a FPS read out then stick with the timer.
  • MarkOnTheIronMarkOnTheIron Posts: 1,447Member
    scitunes said:
    I always try to avoid timers when possible. I think the problem is that it may only exactly equal the x or y coordinant for an instant and it's not long enough. So you could try this if the timer starts causing a framrate issue:

    Lets say you are interpolating to an x of 0 and you are starting at 240. You could check when X ≤ 1

    I also thought that the problem was that when you interpolate it doesn't go to the exact position but maybe a couple of pixels off. So to check if the actor was in position I used a rule that check if the actor was within 10 pixels in any direction from the landing spot but it didn't work. I think it is a bug, maybe the same that affect the move to behavior.

    However since fps are staying between 55 and 60 I will stick with timers.
This discussion has been closed.