bug or intentional feature

FerinFerin Member Posts: 32
edited January 2012 in Working with GS (Mac)
I did try to detect if self.motion.Linear Velocity.Y =/≠0 of interpolated actor in Y axis, but it seems that GS does not consider movement through interpolation as a movement, and can not detect the speed of such actor or if it is moving at all. So my question is like topic title says. And if its intentional is there a way to detect speed or if actor is moving when interpolated?
I've tried to attach another actor to interpolated one by constraining X and Y and display self speed/position on it but it does not change anything.

link to test file

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Intentional.

    Interpolate is not a movement behavior. Interpolate manipulates a specific value. So you could interpolate linear velocity if you wanted but when you interpolate the y position you are just change the position of the actor and not its speed. If your movements are based on interpolate you can actually disable the Movable attribute on your actor which will mean less RAM and better performance and still move the actor around.
  • FerinFerin Member Posts: 32
    Thanks tenrdrmer,
    "If your movements are based on interpolate you can actually disable the Movable attribute on your actor which will mean less RAM and better performance and still move the actor around."
    that's quite good news. But is there any way to detect if an actor is just interpolated?
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Off the top of my head I don't see an easy way of detecting when your actors are moving while using interpolate. Maybe if you give some more detail on what you are actually doing we can help you more.
  • ozboybrianozboybrian PRO Posts: 2,102
    edited January 2012
    I wish there was a simple way to trigger it to stop.. Life would be easier.
    Playing with the moveable boolean will be handy though! Yay I'm learn-ed :D
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    The movable boolean cannot be changed at run time. Is change Velocity to 0 not Simple Enough?
  • ozboybrianozboybrian PRO Posts: 2,102
    edited January 2012
    Ouch, So velocity going to 0 stops interpolation??? I asked a similar question ages ago and no one said that.
  • FerinFerin Member Posts: 32
    edited January 2012
    @ tenrdrmer

    I want to do kind of grid movement not based on X/Y position but depending on intervals between the player's action (mouse clicks, display touches etc) and states of the actor, i.e is moving or not. In other words i want to interpolate actor not more often than every second and only if interpolated actor is not in "moving state", i'm not sure if that makes sense at all but logic is not my cup of tea. There are several actors in the scene that are spawned and interpolated by player's action at the same time. Dunno what i could say more :D.

    Reason why i use interpolate instead of 'move to'/'accelerate' is that in interpolate i can use time rather than speed, which is crucial since my grid is not symmetrical thus making possible to move multiple actors to next point in the same period of time no matter what distance they have to travel.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Well you could always Change A self attribute let call it Self.moving to true when you trigger an interpolate and using a time for the same period of time have a rule

    When self.moving is true
    --Timer After 1 Second
    ---Change Attribute self.moving to false

    You should know though interpolate can be a little crazy if you try to alter the course once its trigger. The way interpolate works is the last interpolate to run over rides any previously running interpolates But… If the last interpolate finished before the one before its time runs out. The next to last interpolate will take back over and finish its run. As long as your interpolates are always running the same time frame though you should not encounter this issue.

    Also the method above has the potential to not work for you if you trigger multiple interpolates before each on is completed.
Sign In or Register to comment.