Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

TweenRotation is acting completely erratically - how do I fix this?

Asked by 5 years ago
Edited 5 years ago

Hello everyone! Don't be daunted by the code below; there's only a few lines of importance, and I just thought that I would break it down for you before clarifying the problem. I'm trying to make a fish that does 3 things in an aquarium: it rotates its head up and down as it swims in the corresponding direction; it, well, always swims; and it rotates so that it swims in a circle inside of the cylindrical aquarium it's in. I got 2 of the 3 of these things working, but when I added in a Tween to make the fish tilt its head up and down over time while the going forward in a circle forever part was working, it overrode the CFraming work that I did there. I couldn't find a way around this, so I changed my code so that every few seconds, the Tween would update to bring the fish to this new rotation. However, the Tween is going completely haywire, and I have no idea why. The fish every 5 seconds consistently, rather than every 1.25 like I programmed it to, updates its new goal of where it wants to Tween to lead it to rotation-wise. Also, it's just going in seemingly random directions despite my simple Tweening code. Please help me out here, and if you have any other suggestions on how to make the fish look up and down at the same time as it rotates in the circle, then please let me know! Thanks in advance!

I can't get formatting to work, so please follow this link to pastebin where I could! https://pastebin.com/CP9R1m2J

0
fix ur formatting Gey4Jesus69 2705 — 5y
0
Working on it OnlineOne 0 — 5y
0
use lerp instead TheluaBanana 946 — 5y

Answer this question