© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
1 reply
massive_boner

❔ Unity deltaTime error

this is my code, when I multiply the damping by deltaTime it breaks the spring but without timeDelta the spring still breaks at lower framerates. what can I do?

public (float, float) Spring(float current, float velocity, float goal,float powerConst, float dampingConst)
{
float damping = velocity * dampingConst;
velocity += (goal - current) * powerConst;
current += (velocity - damping) * Time.deltaTime;
return(current, velocity);
}
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Unity Animations With Time.deltatime
C#CC# / help
3y ago
Unity Error
C#CC# / help
3y ago
❔ c# unity error
C#CC# / help
3y ago
❔ Time.deltatime doesn't works
C#CC# / help
4y ago