Team Spartan Cookies & Milk Forums
Way to make setAng slower? - Printable Version

+- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk)
+-- Forum: Garry's Mod (https://teamscm.co.uk/forum-4.html)
+--- Forum: Expression 2 (https://teamscm.co.uk/forum-6.html)
+--- Thread: Way to make setAng slower? (/thread-2071.html)



Way to make setAng slower? - udop1 - 21-12-2016

Is there a way to make the setAng slower so that when I want to make something rotate it rotates slower than 9 million MPH?


RE: Way to make setAng slower? - Skeleton - 21-12-2016

If I understood correctly your question, you have two ways: stop calling it alot in a short period, so reduce the time you call it.
Or you can keep calling the function like you do, but reduce the amount of angle you change.


RE: Way to make setAng slower? - udop1 - 21-12-2016

Im not calling it a lot, I dont think. I've only made it that if the button == 1 then setAng(ang(vec(0,90,0)))
if button == 0 then setAng(ang(vec(0,270,0))) but it makes the prop move quickly.
Instead should I just make it move one at a time?


RE: Way to make setAng slower? - Skeleton - 22-12-2016

Well if it rotates quickly that means that the function is called a lot in a short time. I'm not really familiar with E2 but I presume you use something like runOnTick(1), that makes the E2 runs the code each tick. You can try reducing this number or reduce the number of the angle you are adding.


RE: Way to make setAng slower? - udop1 - 22-12-2016

It's fine, I've figured it out with some help from Ano.