0 Favourites

How do I anglelerp

  • hello everyone.

    i need some clarification on this.

    If "player" is overlapping "slope"------------------ "player" set angle to anglelerp(self.angle,340,0,9*dt) degrees.

    on the third number which is how fast it will lerp it makes no difference in speed whatever i input.

    meaning if i enter there 0.1 or 0.9 it anglelerps at the same speed.

    what am i doing wrong?

    thank you.

  • actually lerp(a, b, x) should have the x parameter variying, not the a parameter (it is a simple linear interpolation by defining a 0 to 100% value), it just happens that it do something else the way you (and not only you) are using it (I think this is called a geometric progression), but in your case:

    -did the angle moved too slowly? (since 0.9*dt is a very low value, it will stay relatively close to Self.angle, and so self.angle won't vary that much even at the beginning), maybe a 0.5*60*dt will be more noticeable (it should be half way of it's current position 1/60 of seconds later).

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Aphrodite

    you rock as always!

    i will try this and report back.

    Does anyone know if we can pick a specific tile from the tilemap object and enable or disable the sine behavior?

    i know that we can give the WHOLE tilemap object the sine behavior but can we move individual tiles so i wont have to use sprites for this?

  • The tilemap object is one big object, I don t think in C2 you can move one tile (since what defines a tile is it's X and Y position on the tilemap), what could be done potentially would be to compare each tile, and when you encounter a particular tile, you create a sprite over it, and destroy the tile then, this operation would have to be done on the start of layout (maybe it can also work on the tilemap trigger condition "on created", but not sure about that)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)