Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by siddharth3322 · Aug 07, 2014 at 05:54 AM · rotationsmoothing

Gradually reduce speed

Basically I am working on following application of android version Party Games: Drinking Wheel and American Roulette

For this I want to rotate wheel and want to stop wheel at specific point. But I want this with gradually decreasing speed. For example at start I have speed of 10 then at stop time it at 0. So wheel stop smoothly.

At present I have viewed other post and implemented rotation of wheel but it didn't smooth, it stops on the spot. I can't able to figure out whether I have to use physics for this or not?

I want some help in this. Thanks for your time.

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Mayank Ghanshala · Aug 07, 2014 at 07:46 AM 0
Share

you can control speed in $$anonymous$$athf.Lerp I think.

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Issah · Aug 07, 2014 at 08:10 AM

Hi,

Yes Mayank is right, you can try something like :

 currentSpeed = Mathf.Lerp(initialSpeed, finalSpeed, Time.deltaTime);

http://docs.unity3d.com/ScriptReference/Mathf.Lerp.html

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image siddharth3322 · Aug 07, 2014 at 08:28 AM 0
Share

Thanks! I understand your point. For this I will reply you shortly. If I want to write my own Lerp like function then it integrate what coding in that??

avatar image Issah · Aug 07, 2014 at 09:43 AM 1
Share

Im not sure to understand my english is pretty bad. I think you want to code your own Lerp or understand how it works ? Lerp mean linear interpolation : http://en.wikipedia.org/wiki/Linear_interpolation

If you want a regular curve its an affine function like ax + b

I think you want a curve like a log, fast at start and slower with time, and when you'r close to the wanted value you stop your Roulette (cause Log never reach the final value) :

http://en.wikipedia.org/wiki/Logarithm

$$anonymous$$athf is an unity class which provide manny function to calcultate this type of curve :

http://docs.unity3d.com/ScriptReference/30_search.html?q=mathf

I hope it will help.

avatar image siddharth3322 · Aug 07, 2014 at 09:57 AM 0
Share

I have asked question related to this topic so you have to paste your comment as answer there.

$$anonymous$$athf.Lerp like User Define Function

avatar image Issah · Aug 07, 2014 at 10:08 AM 0
Share

$$anonymous$$ayank allready answer :

 public static float Lerp (float from, float to, float t)
 {
    return from + (to - from) * $$anonymous$$athf.Clamp01 (t);
 }

Linear function is ax + b.

In this example :

from = b;

(to-from) = a;

$$anonymous$$athf.Clamp01 (t) = x;

$$anonymous$$y answer is badest than $$anonymous$$ayank answer

EDIT : i will past my answer i have find some new information for you ;)

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

23 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

A node in a childnode? 1 Answer

Rotate GameObject using Coroutine 2 Answers

Unity 2d animation acting strange 0 Answers

acceleration and eulerAngle problem 0 Answers

Updating a collision inside function update? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges