Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Lerp with NO easing??

Author
Message
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 15th Jan 2022 20:27
These 2 lerp routines ...



both work great but the simple logic of linearly interrelating without easing is just eluding me ...

Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 15th Jan 2022 21:04
Calculate it at the start and use that value. Don't calculate it every step
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 15th Jan 2022 21:08
Why use your own lerp function when AppGameKit has them built in?
CreateCustomTween()
SetCustomTweenFloat1(tweenID, from, to, TweenLinear()
hendron
8
Years of Service
User Offline
Joined: 20th Dec 2015
Location:
Posted: 16th Jan 2022 18:20 Edited at: 16th Jan 2022 18:22
Your functions are linear (at least I know the 2nd one is as it's the formula I use). It looks like you might be changing your start_point to be the unit's position every frame? You'll need to keep the start_point and end_point static and move your pct param from 0 to 1 over the amount of time you want it to take to get from A to B.
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 16th Jan 2022 18:37
Thanks for the help guys, I was sure those functions were supposed to be linear and I guess they are if used correctly, silly mistake there on my part I only had to move 3 lines of code to make it work! lol
Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee

Login to post a reply

Server time is: 2024-03-29 06:02:55
Your offset time is: 2024-03-29 06:02:55