• 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 Bigproblem01 · Mar 09, 2015 at 11:04 AM · iostimeparametervibrationvibrate

Vibrate for X time on iOS?

Hey guys,

Does anyone know the way to make the phone vibrate for a desired amount of time? Handheld.Vibrate() doesn't cut it as it doesn't have a time parameter and the phone always vibrates for a set amount of time and I can't seem to find any plugins on the asset store.

If anyone knows the plugin or any other way I could do it, I'd appreciate it.

Thanks!

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 VivienS · Jun 03, 2016 at 03:08 PM 0
Share

Looking for the same thing. Is there anything new since this question was posted?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by alok-kr-029 · Mar 09, 2015 at 11:13 AM

     void Start()
     {
       StartCoroutine("vib");
     }
     IEnumerator vib()
     {
  Handheld.Vibrate();
       yield return new WaitForSeconds (.25f);
     Handheld.Vibrate();
      yield return new WaitForSeconds (.25f);
     Handheld.Vibrate();
     yield return new WaitForSeconds (.25f);
     Handheld.Vibrate();
     yield return new WaitForSeconds (.25f);
     Handheld.Vibrate();
     }

this will make your phone vibrate for 1 sec as after every .25 sec I am calling Handheld.Vibrate(); you can also use loop instead of calling it like this if you have long time period.

Comment
Add comment · Show 3 · 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 Bigproblem01 · Mar 09, 2015 at 01:18 PM 0
Share

I may not have been clear with my question. I need to Vibrate for a specific amount of time, for example Vibrate(0.1f), Vibrate(0.25f), etc.

avatar image alok-kr-029 · Mar 10, 2015 at 04:37 AM 0
Share

http://nikprogram$$anonymous$$g.blogspot.in/2012/10/android-vibration-support-in-unity3d.html

http://answers.unity3d.com/questions/350193/handheldvibrate-duration.html

avatar image Bigproblem01 · Mar 14, 2015 at 10:30 AM 0
Share

I found those links before I posted this and they yielded nothing. I don't know Objective C and don't have time to invest in it right now, so I was looking for an existing plugin

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



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

How to change type of vibration on Android/IOS? 3 Answers

how to make the Playstation 3 controller vibrate? 1 Answer

Did Unity 2017.1. deprecate Vibration on Android? My vibration methods no longer work on newer builds. 1 Answer

How to smooth between values? 2 Answers

Network Vibration Problem 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