r/Unity3D • • 1d ago

Question How to control speed over time ?

Post image

For example I want after 1 min the speed is 15 and then lock this value for 5 minutes then after that increase till 20 and so on
how to make this possible ?

255 Upvotes

81 comments sorted by

534

u/KptEmreU Hobbyist 1d ago

Honestly I enjoyed seeing this naive question being asked here , this day and age. Reminded me of old good days.

150

u/DifferentLaw2421 1d ago

Yh same , I try my best to rely less on ai because I genuinely want to learn how stuff are built

41

u/Int-E_ 1d ago

You can use ai to learn stuff, you just have to ask the right questions

35

u/Creepgamer27 1d ago

I kinda disagree, when I use ai I tend to remember things less due to the nature of the instant answers it gives. I've recently been learning a new engine(godot) and restricting myself to solely documentation and Google has done wonders in getting a deeper understanding instead of just asking ai quickly.

I agree on it being helpful in getting stuff done fast but isn't great for building up knowledge

7

u/Int-E_ 1d ago

ig that's fair. I use it for learning and it's helped me improve my skills a lot. But I don't ask it for code and i don't actually tell it what I'm trying to do.

I break my problem into simpler problems and find out what knowledge I lack about the engine to solve it. Then I ask it how to do that in the engine. Then it tells me the function or tool that matches my needs and I ask it followup questions to actually understand the tool/function, and then implement the solution myself

Basically, I use it like a very smart search engine

2

u/Creepgamer27 1d ago

Yeah thats fair, its more that at that point a regular search engine + the documentation should suffice

1

u/Int-E_ 1d ago

It's just faster to use an llm instead of a search engine. And you can get more specific with your questions

0

u/AtumTheCreator 22h ago

If you read a book, or watch a youtube videos you wont remember it any better...even time in the saddle won't make you remember everything.

You will always need to reference something.

3

u/AssignedSlothAtBirth 21h ago

Yeah, its called documentation and it did the job pretty well for some odd 50 years

2

u/AtumTheCreator 18h ago

Thats my point.

1

u/Creepgamer27 11h ago

While you won't remember everything, there has been research pointing towards taking "the slow approach" improving your ability to recall. If you want I can go looking for the paper again but I don't have it on hand right now

3

u/pie-oh 17h ago

I honestly disagree with you. Though I know where you're coming from.

I don't disagree with asking AI questions, but for this level of learning - I truly think learning from other humans is way better. Humans have a different set of reasoning skills, and it usually comes from past experiences. AI's is more an amalgamation.

1

u/Badzieta 1d ago • Regret

Learning with AI is very cheap learning. If he had the same question before LLMs era, he either would have to ask it like he asked here, and have bunch of different answers, he would have to go through each one of them, analyze it and figure out which one makes most sense; or he would have to go through countless forums/articles and read all shit that someone did come up with and do same critical thinking I have brought up earlier.

Now if you ask AI something to explain to you, it will answer your question right away, it will be direct answer to your sole problem, you won't learn much rather than read some simple answer that LLM brought up to you (not to mention that it can be simply wrong and you will outright believe it as you don't have other answers to compare with)

9

u/Int-E_ 1d ago

thats why I said you need to ask the right questions. basically question everything it does. understand its reply and come up with questions like 'what if we do it this way?'.

Also, it can be wrong, but the new paid models like sol/astra, and anthropic's models hallucinate a lot less and are very good at teaching since they can use all kinds of features like making mini interactive apps, diagrams, finding relevant images through the web, etc. You'll understand just how much better they are than the free tier models right away when you use them.

I studied for my university exams entirely through 6.2 sol and the result was great. I mean they are quite literally smarter and much more capable. They can do things that free tier models outright can't do

-1

u/ThreeHeadCerber 1d ago

How can one question what AI tells you if ones level of knowledge is the one that requires to ask the OPs question? At this basic level you have to accept what you're told.

1

u/Int-E_ 1d ago

At that level the answer's also going to be basic and easy to understand though, there wouldn't be much to question.

2

u/ThreeHeadCerber 1d ago edited 1d ago

Th response would likely be the solution is a state machine and while it is a basic concept, it wouldn't be that easy for a newbie to understand and almost impossible for them themselves to verify if it actually is.

0

u/Int-E_ 1d ago

Why would you need a state machine for it? This is what I got

The easiest way to do this in Unity is using an AnimationCurve or a Coroutine. If you want to gradually increase speed, hold it constant for a certain duration, and then increase it again, I'd recommend AnimationCurve because you can visually control the speed over time directly from the Inspector.

And then it proceeds to explain both the concepts

Even if it was state machine, op can ask it to explain state machines. And I'm not saying you should 100% rely on llms. You can watch videos or use other resources for particular difficult topics.

6

u/Ok_Zookeepergame3380 1d ago

Are you telling me having a teacher is cheap learning?

-34

u/dreasgrech 1d ago

How is just asking the question here make it any different from asking it somewhere else?

32

u/IZEDx 1d ago

They get to experience the good old dynamics of online forums for asking questions, where youre not being spoonfed but insulted and gatekept while given just enough hints as to figure it out themselves, which actually helps in better understanding how it actually works and internalizing this experience while also spreading an elitist gatekeeping mindset.

But looks like people haven't experienced a genuine question like this in so long, they're actually happy and eager to help lol

Man i miss the good old days. It sucked coming new into a community or field but there was something special about those dynamics and passing on the torch to the next generation, it was a ritual of sorts

20

u/mih4u Hobbyist 1d ago

"Archived this question as duplicated question"

[Some link to a similar question from 2018 for another version of the engine that worked completely different back then]

Best regards SmugMod42069

5

u/dreasgrech 1d ago

Say what you will about SO, but I really do miss the days where you could have a casual chat with Eric Lippert or Jon Skeet on a Tuesday afternoon about the CLR internals or the upcoming Tuple definitions.

Good times, and only found that on StackOverflow. But I think people only seem to remember the duplicate question closing memes from there, which is a shame.

1

u/IZEDx 1d ago

There's still some similar chats happening in random, obscure discord servers especially in smaller tech bubbles. Being able to find a library, stumbling upon some weird edgecase, joining their discord server and getting into weird discussions about said edgecase with the maintainer directly is still a thing sometimes. Had it happen with some very obscure minecraft library the other day and the maintainer sent me dev build after dev build to try out and report back

5

u/dreasgrech 1d ago

But SO was indexable, unlike Discord servers.

3

u/IZEDx 1d ago

Yep which is a huge downside which even discord themselves have recognized by now by making at least some parts of it indexable (or planning to? I read it not too long ago)

I think nobody foresaw how much internet communication would actually be moved from forums to discord, and the implications this now has. It was just intended as a skype/teamspeak/irc alternative at first after all

1

u/isolatedLemon Professional 1d ago
  • You google a question
  • first google result is a forum where someone already asked the same question
  • single reply from a stranger "google it"

The good ol days

3

u/Abkenn 1d ago

First, before asking people how something is done usually means you tried yourself and it really didn't work, you did some research and couldn't find your answer, so you decided to ask people who might give you multiple alternatives for you to try and decide which works best or which is written the way you like to see.

Second, by asking real people online, your question will inevitably be discoverable in Google for others to find it during their research of the same problem or a similar problem in the future. People researching how something is done and finding many different solutions would mean that people still care about learning and still care about writing good code. Some don't and will just copy paste the first solution they find online but often these devs never become devs for a living and quit their little gamedev hobby.

Now with AI bad software engineers (usually artists) can prompt Claude to make their dream game with the art, animation and music they've crafted when software engineering was always the most essential part in the past, the real art of gamedev - design patterns, architectures and wonder. Just look at Motion Twin on GDC on creating helper functions to improve game feel or Noita's devs on simulated live pixels interacting with each other in a custom game engine or Obra Dinn and its brilliant technology that's actual art in the visual sense.

2

u/Silver4ura Intermediate; Available 1d ago

I generally don't like using AI both out of principle and because I find it takes a lot of the fun out of writing my own scripts.

However one benefit it does have when it comes to learning is the ability to figure out what you're trying to say or ask while also being available for immediate followup questions or clarifications.

I've wasted whole evenings trying to find out something that ended up being extremely trivial, only because I didn't know any relevant keywords and using phrases is a crapshoot when every result is from other people equally unsure what to search for and used similar phrasing for a completely different question.

AI doesn't get bored or annoyed when you repeatedly rephrase or provide extra context.

1

u/XeVoriax 19h ago

bet the old days had way more fun questions like this, you miss em that much?

1

u/clockwork_blue 21h ago

For a moment I thought someone crossposted a very old thread. It's so weird (not in a bad way) seeing someone asking this in the age of AI

20

u/Hellothere_1 1d ago edited 1d ago

People have already given a bunch of good answers already, but personally I would probably implement something like this with a Coroutine, which is basically a function whose execution you can suspend between frames. The big advantage of coroutines is that they allow you to very easily create create longer sequences of actions without requiring some manual state keeping variable to remember what position of the sequence you're in.

For your purpose a coroutine might look something like this:

IEnumerator ItermittedlyAccelerate()

{

while (speed < 15)

{

yield return null; //wait until next frame

speed += acceleration * Time.deltaTime;

}

speed = 15; //ensure the speed is exactly 15 for the cruising phase since the acceleration phase might have put it slightly higher

// Suspend Coroutine for 5 minutes

yield return new WaitForSeconds(300);

while (speed < 20)

{

yield return null;

speed += acceleration2 * Time.deltaTime;

}

speed = 20;

}

This function first increades the speed to 15, then waits 5 minutes befor further increasing it to 20. As you can see doing it like this a lot easier this than manually implementing the acceleration and waiting phases inside the Update() function.

10

u/DifferentLaw2421 1d ago

OHHHH I liked this approach and I understood it directly thank you so much

3

u/ThreeHeadCerber 1d ago edited 1d ago

coroutines and async methods are a very clean and readable ways to write state machines and probably good to start with, but make sure you understand how they work and be ready to find out that you can't really use them when you would really like to because a state saved in non-serializable way is not good for games.

2

u/charmys0 1d ago edited 1d ago

What did you mean with so on? Otherwise you could run the code recursefly... also you wanted the speed to be 15 after 1 min is it supposed to accelerate to 15 after 1 min or should it be a linear increase over 1 min

2

u/Neither_Berry_100 1d ago

One thing that worries me about co routines is determinism. I'm not sure if they are deterministic or the best approach here. My current game is multiplayer. Lots of stuff are done to ensure it matches on all machines. I haven't looked into co routines and would just avoid them for now. I don't have an actual use for them atm. I would be prepared to build my own deterministic co routine implementation if necessary. It would probably be a little worse to use.

5

u/Hellothere_1 1d ago

Yes, coroutines are deterministic, at least to the same degree that the rest of Unity's Monobehaviors are.

I think you may be confusing them with threads. When you launch a thread the entire function gets run on a different processor core at it´s own speed, completely independent of what is happening on the main thread (which in Unity is responsible for calling Updates, running the entire game loop, and render calls to the GPU.) Depending on what other stuff is happening on the computer at the same time the speed at which different threads execute different functions can vary quite significantly.

To be clear, threads can still be made bout as deterministic as you need, but there's also a lot of stuff you need to consider in terms of concurrency and thread safety of variable calls. Also, any calls that affect stuff in the world scene must only be done from the main thread.

Coroutines are different in that they run entirely on the main thread. When a coroutine is updated it will simply execute the code inside until the next yield instruction, then interrupt itself until called again. Then it will continue at a specific point in the Unity update loop which is usually directly after the equivalent normal monobehavior updates are done. For example if you call "yield return new WaitForFixedUpdate();" Unity will run the coroutine again after all normal "FixedUpdate()" functions are done.

The only thing that's potentially non-deterministic about it is the order in which specific updates to different coroutines happen in the same frame, but that's the same with normal Update() calls too.

1

u/ThreeHeadCerber 1d ago edited 1d ago

Coroutines are deterministic, but you can't save their state and resume from arbitrary point. Which makes them really bad for game logic and anything one might care about losing.

1

u/Neither_Berry_100 1d ago

Still a problem i think. You say yield 1 second. That might be 59 frames or 60 or 61 or whatever on a machine targeting 60 fps. I need exactly 60 frames in this case. It won't work for keeping the multiplayer games synced up.

2

u/Hellothere_1 23h ago

If you always want to wait for 60 frames rather than 1 second you can just do a run a for loop with yield return null and run it 60 times.

1

u/Neither_Berry_100 23h ago

OK. But there is no performance benefit in this case... I still don't see any reason to use them myself. But thanks for the response.

Also this doesn't work for me because I skip frames. The engine runs at 90 fps but the actual game runs at 60 fps. I needed it tied to my update calls lol. Not the engine updates.

2

u/Hellothere_1 20h ago

Also this doesn't work for me because I skip frames. The engine runs at 90 fps but the actual game runs at 60 fps. I needed it tied to my update calls lol. Not the engine updates.

Then either use FixedUpdate (that's literally what its for) or built your own coroutine manager. I've done it before and it's really not that complicated.

Also, at least personally one of my main uses of coroutines is actually to control some visual only effects that don't affect any game logic, in which case you want to stick to visual frames anyways.

OK. But there is no performance benefit in this case...

Using coroutine patterns in gamedev is usually not about performance, it's about code readability redability and organization. Triggering a simple coroutine that performs a few consecutive functions over a short amount of time is often significantly more lean and easier to understand than building a small state machine for every single timed action.

It's not always a good fit, but for certain tasks it's extremely extremely useful.

4

u/OpenthedoorSthlm 1d ago

And you want a gradual increase I assume?

1

u/DifferentLaw2421 1d ago

Yh , then at some point I want to lock the speed for some amount of time (for example 5 minutes) then increase it

118

u/Molehole Hobbyist 1d ago edited 1d ago

Time.deltaTime gives you time since last Update().

You can in an update function add Time.deltaTime in a float variable and then that tells you how much time has passed.

If you want a variable to reach x in for example 120 seconds the increase is

x / 120 * Time.deltaTime

38

u/Soraphis Professional 1d ago

Create a variable of type "AnimationCurve" use it's evaluation function to pass in time and read out it's value and use it as speed.

Now you have all the control in the inspector to adjust the curve to your liking.

Not the best solution for this IMHO, but an easy one that gives you enough control to play around with

8

u/DapperNurd 1d ago

It's a little bit of a different approach, but I'm gonna suggest it mainly because they are so useful everywhere. But I would suggest looking into Tweens. I use PrimeTween (allocation free). Another popular one is DoTween.

They allow you to easily calculate a curve value anywhere in the code, synchronously or asynchronously. You give them a start value, an end value, and a duration. They also let you customize a bunch of stuff about them including the easing of the tween.

7

u/Demi180 1d ago

Edit: sorry in advance about the shitty formatting, mobile doesn’t have code formatting anymore 🙁

First, you’ll want to include Time.deltaTime when increasing or decreasing speed so the change doesn’t depend on your frame rate. For example, to make a variable x increase by 5 over 2 seconds, you could write:

x += Time.deltaTime * 5f / 2f;

To keep track of the speed transitions you could make a small class to hold the values you need for each part of the level, and have an array of those you can set in the inspector. Something like this:

[System.Serializable]
public class SpeedPart
{
public float targetSpeed;
public float timeToReachSpeed;
public float timeToNextPart;
}

public SpeedPart[] parts;

Then you store the index of the current part and a timer to the next part along with the current speed:

private int partIndex;
private float nextPartTimer;
private float lastTargetSpeed;

Inside the speed function, first check if you’re at the target speed, and either increase the speed or tick down the timer to the next one:

SpeedPart part = parts[partIndex];
if (speed >= part.targetSpeed)
{
nextPartTimer -= Time.deltaTime;
if (nextPartTimer <= 0 && partIndex < parts.Length - 1)
{
partIndex++;
}
}
else
{
speed += (part.targetSpeed - lastTargetSpeed) * Time.deltaTime / part.timeToNextPart;
If (speed >= part.targetSpeed)
{
speed + part.targetSpeed;
lastTargetSpeed = speed;
nextPartTimer = part.timeToNextPart;
}
}

Just remember the times will be in seconds, so you can either specify that in the array of parts (i.e. 60, 120, etc) or just always multiply times by 60 when updating the values.

1

u/SlRenderStudio 1d ago

First of all use mathf.move towards and then use delta time if in update (fixed delta time ), then do this with if else logics or switch logic for all the points assuming you want linear increase if wanted different speed then it get bit complicated , if you have lot of point and need to spam lot of if else logic i recommend use animation curve or at least loop and data arrays

1

u/Ejlersen 1d ago

I would create a small struct to contain two duration values. One for speed ramping, the other to hold that value. Then you can hold an array of these values. Then store your time and an index to to the current one. Use this to calculate your speed. Each time you swap to the next step, then reset the time. For you don't want to store the absolute duration values, since if you change one of the earlier steps, then you have to change all steps after that.

1

u/lastFractal Solo 1d ago

Not an answer to your question but I felt the urge to do

speedReached = (speedOfLevelParts >= 15)

does the exact same thing as your if statement, is shorter and nicer to the eye IMO. Only exception is that it's much more limited, but it's (subjectively) better for doing simple assignments like this

1

u/ThreeHeadCerber 1d ago

I don't see explicit state machines suggested in the comments whereas this is the most basic and very useful in game dev way of doing things. You will later learn more specialized tools and library implementations of state machines (google: FSM) and you can for sure make them more effective, but just the basic handwritten one can take you very far in game dev

1

u/SnooRegrets369 23h ago

Perhaps use nested Coroutines for cleaner and readable logic. Not sure but could work. A routine for each timer check and speed increase you want. Trigger next coroutine after condition is met and ensure you stop the coroutine before yielding the next one. You probably also want a getter function which calculates and returns current value across all so you have a state to check against.

1

u/joshualim007 Indie 22h ago

Everyone fails to mention you also need to clamp the values too. At large timesteps, the error without a clamp becomes very noticeable.

1

u/_cooder 17h ago

i dont saw anything in coms so

if you want something like buff, and control it outside or depends bla bla bla you need to create something like buff or controlling system with hand made function from Internet/ai/desmos

bc you said it based on time

1

u/Neither_Berry_100 1d ago edited 1d ago

I suggest a state machine pattern. Usually using a byte. Although in this case a bool will do.

Control Speed () { if is increasing increasing(). Else hold(). }

Hold() { time += time elapsed. If time = 5 minutes then is increasing = true }

Increasing() { speed += time elapsed * rate; if speed >= limit then finish increasing() }

Finish increasing () { speed = limit. Limit += 5. Time = 0. Is increasing = false. }

You should be able to understand this and fill in the details. Add the member variables and constants. Use the right delta time. Finish increasing should be done directly not as it's own function. Just easier to type on my phone.

Normally you use like a byte state instead of bool is increasing. And a switch to select the branch. Very useful design pattern that I've used a few times in my current game.

Edit. I've read the other answers here. I think mine is the best. First in terms of size. Second in terms of the reusability of the design pattern. And third in terms of the simplicity and lack of problems that come with it. Co routines for example could easily get you into trouble.

-3

u/deintag85 1d ago
using UnityEngine;

public class LevelSpeedController : MonoBehaviour
{
    [System.Serializable]
    public class SpeedStage
    {
        public float targetSpeed = 15f;
        public float rampDuration = 60f;   // seconds to reach targetSpeed
        public float holdDuration = 300f;  // seconds to keep it locked
    }

    [SerializeField] private SpeedStage[] stages =
    {
        new SpeedStage { targetSpeed = 15f, rampDuration = 60f, holdDuration = 300f },
        new SpeedStage { targetSpeed = 20f, rampDuration = 60f, holdDuration = 300f },
        // add more stages here
    };

    public float speedOfLevelParts { get; private set; }

    private int stageIndex;
    private float stageTimer;
    private float stageStartSpeed;

    void Update()
    {
        ControlSpeed();
        // use speedOfLevelParts * Time.deltaTime to move your level parts
    }

    void ControlSpeed()
    {
        if (stageIndex >= stages.Length) return; // last stage finished, keep final speed

        SpeedStage stage = stages[stageIndex];
        stageTimer += Time.deltaTime;

        if (stageTimer < stage.rampDuration)
        {
            // ramping phase
            float t = stageTimer / stage.rampDuration;
            speedOfLevelParts = Mathf.Lerp(stageStartSpeed, stage.targetSpeed, t);
        }
        else if (stageTimer < stage.rampDuration + stage.holdDuration)
        {
            // locked phase
            speedOfLevelParts = stage.targetSpeed;
        }
        else
        {
            // stage done, start next one from the current speed
            stageStartSpeed = stage.targetSpeed;
            stageTimer = 0f;
            stageIndex++;
        }
    }
}

-6

u/lowercaseyao 1d ago

You’re using AI wrong if you’re copying pasting. It will explain every line for you, based on info from everywhere on the web, including reddit. Use that knowledge to test yourself elsewhere to learn.

-33

u/Ue5Artist 1d ago

Ask ai lol

12

u/DifferentLaw2421 1d ago

I do not want , I want to learn not just copy paste

-6

u/Ue5Artist 1d ago

Who's trying to say copy paste lol. Just ask any ai tool it will answer you how you can do it understand it's intention what it's trying to say and what. Then implement logic. Simple

9

u/DifferentLaw2421 1d ago

Idc I want to ask the community so everyone can give his/her way to do it

2

u/Express_Music3310 1d ago
[Serializable]
public class SpeedSetting
{
    public float Speed;
    public float LockTime;
}

public class SpeedController : MonoBehaviour
{
    public float Speed;

    [SerializeField] private SpeedSetting[] speeds;
    [SerializeField] private float acceleration;

    private float lockTimer;
    private int currentIndex;
    private void Update()
    {
        if(currentIndex >= speeds.Length)
        {
            return;
        }

        var currentSetting = speeds[currentIndex];
        Speed = Mathf.MoveTowards(Speed, currentSetting.Speed, acceleration * Time.deltaTime);
       
        if(Speed >= currentSetting.Speed)
        {
            lockTimer += Time.deltaTime;
            if (lockTimer >= currentSetting.LockTime)
            {
                lockTimer = 0;
                currentIndex++;
            }
        }
    }
}

This is a simple implementation that I threw together. Not the greatest but I think it's easier to understand

-1

u/IZEDx 1d ago

I respect your approach a lot, keep it up for as long as you're willing to, but unfortunately u/Ue5Artist is also right in that AI can genuinely be really good at teaching you concepts like these and as you're seeing from rhe plethora of different responses here, both in approach and quality, there's also downsides in relying on the community. Back in the day we used to google first, sifting through countless obscure online forums or stackoverflow threads before we'd ask a question online, especially because if you didn't do that legwork upfront, people would insult you for being lazy and wanting to be spoonfed.

It's kind of ironic how the dynamic has changed.

My recommendation would be to not be afraid to ask AI every now and then to explain you things, but sticking to the principle to not let it generate full code snippets would be good advice for actually learning it yourself, as it's a slippery slope.

Alternatively, I'd recommend using a non-AI search engine to still try to look up stuff yourself the old fashioned way, stackoverflow is still up and running after all and especially for usecase like yours there are still plenty of old school tutorials and questions out there.

Right now you essentially treated this community just like an AI, only substituting it with humans. Dont forget to do the legwork of researching stuff yourself.

1

u/DifferentLaw2421 1d ago

So using ai in proper way without generating full code for learning is not considered a bad thing ?

2

u/SchalkLBI Indie 1d ago

Don't listen to them. You're right. You're doing things the correct way. Good on you for learning from people and not LLMs. 

0

u/IZEDx 1d ago

What is good and bad? It depends on your principles.

If its ideologically about using/supporting AI then tough luck, i can guarantee you almost none of the software you use nowadays doesnt use AI in their development workflow to at least some extend.

If it's because you want to properly learn these things yourself without relying on or falling trap to AI because youre worried it will make you lazy and you wont actually learn what you want to learn, then it's more nuanced and depends more on how principled you are in your AI usage. If you're strict about it, for example by priming the AI by going into the settings and adding context about how you want to learn to code but not be given full code snippets etc. then i believe you should be fine.

Its about if you treat the AI like a teacher/tutor or like a code generator, but the responsibility would lie on yourself. AI is technically just a tool after all, and ultimately, on the internet nobody knows you're a dog

-4

u/Ue5Artist 1d ago

That's you perspective then.

4

u/SchalkLBI Indie 1d ago

Username checks out 

-3

u/Neither_Berry_100 1d ago

This is a valid answer. Sorry you are getting down voted. In particular so many people ask simple questions like how to start in game development. This is asked regularly. I have little hope for them. Game development is hard and you need to constantly solve stuff on your own. Either A Google the old fashioned way and figure it out yourself. Or B ask ai to come up with a plan. Questions like this should be mainly for unique use cases and advanced questions. Still I often respond to them.

1

u/Aethenosity 22h ago

This is a terrible garbage inhuman answer. They, and you, deserve to be mocked.

-6

u/virt111 1d ago

I've started lerping all of these kinds of functionalities. Just love telling an llm to "lerp this shit from x to y with these x to y" and I get a ready to go function.

-9

u/NecoDev 1d ago

Sorry but I am trying hard not to laugh, I can't tell whether this is a serious question or not.

To control the speed over time I think it should be speedOfLevelParts += Time.deltaTime * [insert value here]; if I understand what you want.

ALSO you can simply do speedReached = speedOfLevelParts >= 15; instead of using an if else statement.

4

u/DifferentLaw2421 1d ago

Bruh what ig you did not get the point , I want to control the speed over an interval of time not just increase it (read the body of the post )

0

u/NecoDev 1d ago

Oops sorry

2

u/Neither_Berry_100 1d ago

You missed the point. It is a little more complicated than this.