Interpolated angles

This forum is currently in read-only mode.
From the Asset Store
3D Car Pack 1
$2.99 USD
3D models + Rendered Low-Poly Cars in isometric, top-down, and side angles.
  • I'm sure most of us are aware of the issue of using lerp to set a sprite angle because of the fact that it only accepts 0- 360, so anything above 360, or below 0 gets reset.

    That pretty much makes that useless,... but I've figured a way around this issue, and I thought I would share it here to help others, as well as add a suggestion for some future C0.xx update to make it even more useful.

    -> Sprite: Set animation angle to lerp(Sprite.animationangle,Sprite.Value('angle'),1-0.005^timedelta)[/code:1kyx5g52]
    
    Set animation angle is not restricted by the 0-360 limit, so you can set it to what ever value you like.
    However... anyone experimenting on this will probably notice that there is no get Sprite.animation angle.
    You can use a pv instead, but for ease of use, I think the expression is definitely needed.
  • Didn't I add an anglelerp expression a few builds ago? I can't check right now, my laptop's broken!

  • Not that I know of. There's the system expressions angledif(a,b), and rotateangle(start,end,step), but nothing to override the normal limit without a few extra events.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • here ya go:

    http://dl.dropbox.com/u/1013446/math.rar

    I've been meaning to release a math thing for a while, consider this plugin fully working and stable, anything I add from here won't interfere with old caps. I'll probably add 3d math next. this is an easy to make and easy to use thing I'll have no trouble adding to as I work on my current project

    example usage:

    http://dl.dropbox.com/u/1013446/angler.cap

    ps: s has this function but I oopsed it up. I"ll have to fix that later

  • Cool!

    Pretty good idea too, considering the current development status.

  • Very cool addition indeed lucid!

    I mostly made use of the 'Is angle clockwise/anticlockwise' condition and rotated the object accordingly using lerp(like in this thread), but this seems a lot handier.

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