Profile image

Help!

93.4k winterro  3.5 years ago

im trying to make my walkers leg speed adjustable, but dont know how to do it!

I mostly use Throttle*cos(Time*500)as a code to operate my walkers, but i want to be able to adjust the (Time*500) part in-game with a slider. The 500is the leg speed that repeats to 1 and -1 and controls the speed of the leg
from 1 to-1 i want to use a code thats able to change the 500part like from 500 to 800or 800to 300

Could you please help me with this, it would help a lot!

  • Log in to leave a comment
  • Profile image
    93.4k winterro

    @scratch thx! this code works amazing

    3.5 years ago
  • Profile image
    23.1k Scratchoza

    @edensk Thanks for indirectly helping me understand the lerp functions lol

    3.5 years ago
  • Profile image
    23.1k Scratchoza

    sorry I'm late but I think you can use:

    Throttle * cos(sum(lerp(300,800,VTOL/2 + 0.5)))
    .
    basically: a * cos(sum(lerp(min,max,(a / 2) + 0.5)))

    it's smoother too I think

    3.5 years ago
  • Profile image
    93.4k winterro

    @edensk thx, Il try that!

    3.5 years ago
  • Profile image
    16.5k edensk

    Throttle*cos(Time*(300+inverselerp(-1,1,Trim)*500))
    in theory -1 trim will make it 300 and 1 800, as well as 0.5 550....

    3.5 years ago
  • Profile image
    93.4k winterro

    @t0mato72 imma try that

    3.5 years ago