Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 davejones1 · Mar 11, 2018 at 05:17 PM · unity 5c# tutorial

How do I change the speed at which the slider moves?

@Daemonhahn @meat5000 @Bunny83 @robertbu @Eric5h5 @whydoidoit @clunk47 @Mike 3 @Aurore @DaveA @tormentoarmagedoom @Azzydude24601 @draber @cmz-neu4590 At the moment the slider can be moved fast and the animation gets played rapidly. I want to limit the speed at which the slider can be moved so that the animation is seen at more suitable speed. using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI;

public class animationcontrol : MonoBehaviour {

 public Slider slider;
 public Animator animator;
 public Text step1p1complete; 

 void Start ()
 {
     slider.onValueChanged.AddListener (delegate {OnValueChanged ();});


 
 }


 private void OnValueChanged()
 {
     animator.speed = 0;
     animator.Play("anim1", -1, slider.normalizedValue);
 
 }

 public void maxvaluereached()
 {
     if (slider.value >= 1) {

         step1p1complete.enabled = true; 


     }
 }

}

Comment
Add comment
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

5 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by tormentoarmagedoom · Mar 12, 2018 at 12:32 PM

I never tried, but all elements like sliders, buttons, etc have a script that manage it. When you create a slider via Unity, it adds the slider script to the object.

You can duplicate the script, try to find and change thje speed, and use your modified script with that slider.

But as i said, i've never tried it

Comment
Add comment · Show 6 · 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 davejones1 · Mar 12, 2018 at 12:34 PM 0
Share

I have tried to duplicate it but I can't seem to do so. When I try and edit the slider script I am unable to.

avatar image tormentoarmagedoom davejones1 · Mar 12, 2018 at 12:48 PM 0
Share

read this post. Is about buttons scripts, but i supose its the same

avatar image davejones1 tormentoarmagedoom · Mar 12, 2018 at 01:12 PM 0
Share

I have read the post, but it doesn't seem to provide a solution to my issue.

Show more comments
avatar image
0

Answer by davejones1 · Mar 12, 2018 at 11:07 PM

I realise that no one will know a solution to this problem, however it was worth a punt.@Daemonhahn @meat5000 @Bunny83 @robertbu @Eric5h5 @whydoidoit @clunk47 @Mike 3 @Aurore @DaveA @tormentoarmagedoom @Azzydude24601 @draber @cmz-neu4590

Comment
Add comment · 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
0

Answer by EvanCheddar · Jun 26, 2019 at 07:32 PM

Anyone find a solution to this in 2019?

Comment
Add comment · 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
0

Answer by pantang · Feb 24, 2020 at 01:19 AM

clamp math on value change?

Comment
Add comment · 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
0

Answer by adem_rodriguez · May 28, 2021 at 11:25 AM

not sure if it's what you are looking for @davejones1 , but if whole values box is checked ; you can unchecked from the script on the OnValueChanged Event (work better if you have a button instead of an event) , then increase/decrease the silder.value gradually ( by 0.05f for example ) until it reaches the next whole number ;)

Comment
Add comment · 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

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

155 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 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 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 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 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 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 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

How do I make script in C# the result will execute if all the boxes is fill up? 0 Answers

raycast 2D script issue 1 Answer

prefab clones not getting destroyed . 4 Answers

Can you guys help, I basically want to collide 2 game objects to initiate the third one, for example when I drag the pasta on plate these two object will destroy then pasta outcome will initiate.. 1 Answer

Trouble With Loading Bar Script C# Unity 5 1 Answer


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