Interpolate inconsistencies

inceptioninception Member Posts: 74
edited November -1 in Working with GS (Mac)
Hey all. I'm rather new to the scene and am looking for help on this small problem.

I have some very simple code that Interpolates the self.position.y of the actor to +10 when clicked. After 3 seconds, a second rule does the reverse (-10 from its position). Interpolate durations are the same, and both are linear.

The problem is that it will go up, wait, then drop back, but it will not always do so in the same way. Sometimes it will go up and down to the same original position fine, but then on the 3rd or 4th click, drop an extra 3-4 pixels. I just cannot figure it out, it's a brand new project, and nothing could possibly be telling it to randomly change positon.

Any help would be appreciated.

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    You only need one rule for this.

    self.position.Y = 100
    Interpolate self.Position.Y to 200

    otherwise

    self.position.Y = 200
    Interpolate self.Position.Y to 100

    Make sure you actor is in either the Y 100 or 200 position in your scene.

    Darren.
  • Fodder76Fodder76 Member Posts: 154
    That may be a better way for inception to accomplish that specific task, but the inconsistencies in interpolation still exists.

    I'm having issues tiling actors. Trying to create a scrolling background and there is always a gap between actors, varying in size, and this shouldn't happen. Anyway around this?

    Thanks very much in advance.
  • UtopianGamesUtopianGames Member Posts: 5,692
    If the art tiles as in a single 480x320 background you can make the actor say 4800 and go into the graphics and select tile in the X.

    Darren.
  • Fodder76Fodder76 Member Posts: 154
    well, its important for my game that I'm able to randomize the environment, so that's why I want several smaller pieces that I can swap rather than one long repeating piece.

    Thanks for your help and anyone else that may be reading this.

    Chris
  • inceptioninception Member Posts: 74
    Thanks for the help Darren, but I realise I misspoke. When I said second rule, I meant a second behaviour, it is all in one rule.

    I appreciate your example, but unfortunately I need it to be based on the current position+/- an amount, rather than a fixed location.

    It must clearly be a bug, because it is such a random occurrence. It might return to the correct position 4 times before going off, or sometimes only once.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    I was experiencing so weird things using interpolate to move when trying to recycle the actors. So may be a bug. I just assumed I wasn't getting some of the code right. I ended up going back to spawning and destroying cause I couldn't get it to function correctly.
  • inceptioninception Member Posts: 74
    tenrdrmer said:
    I was experiencing so weird things using interpolate...

    There must definitely something wrong with the underlying code of the interpolate function then. Hopefully the devs see this and might be able to respond.
  • UtopianGamesUtopianGames Member Posts: 5,692
    Give me 10 i will make a video.

    Darren.
  • Fodder76Fodder76 Member Posts: 154
    I'm glad to see this is continuing, and I look forward to the video.
  • UtopianGamesUtopianGames Member Posts: 5,692


    Hope it helps,

    Darren.
  • inceptioninception Member Posts: 74
    Thanks for that Darren. I ended up coming up with pretty much the same workaround earlier today.

    It still remains, however, that clearly there is an underling problem with the behaviour based on the situation in my original post. Hopefully it will be fixed in a future release.

    Thanks again.
  • simo103simo103 Member, PRO Posts: 1,331
    thanks Darren .. very helpful .. greatly appreciated.
Sign In or Register to comment.