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 Essential · Apr 22, 2012 at 02:36 AM · updatetouchscreenfixedupdategesture

iPhone / iPad touchscreen input in update or fixedupdate?

Quite a simple question but can't seem to find a solid answer.

Should touchscreen input (virtual buttons and swipes and other gestures) be called in Update or FixedUpdate?

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

1 Reply

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

Answer by ScroodgeM · Jul 22, 2012 at 08:04 AM

All inputs should be called in Update functions

FixedUpdate must be used for game physics only

Comment
Add comment · Show 5 · 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 Essential · Jul 22, 2012 at 07:56 PM 0
Share

Thanks for the reply Scroodge$$anonymous$$. Although I'm curious, wouldn't the precision of touchscreen gesturing, especially in regard to the speed of the player's finger movement, be better to gather in FixedUpdate, rather than in Update?

avatar image ScroodgeM · Jul 22, 2012 at 08:08 PM 1
Share
  1. FixedUpdate() will not let you get more precision for Inputs since Input updates every Update()

  2. to get speed of finger movement just divide movement offset since last Update() by Time.deltaTime

avatar image Essential · Jul 22, 2012 at 08:10 PM 0
Share

Ahh, that makes more sense. Thanks Scroodge$$anonymous$$!

avatar image rawmantick · Sep 16, 2013 at 01:18 PM 1
Share

Thanks. Update for input, and FixedUpdate for physics. But what if physics is continuously updated based on input? Let's say if a finger is keeping touching the screen and based on its position some physical effect is calculated and applied to the game world? Where to put such?

avatar image rpmlins · Sep 16, 2013 at 02:43 PM 0
Share

@rawmantick here is a great example for your question: Getting Your Input To Work Properly. I hope it helps.

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

6 People are following this question.

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

Related Questions

Help with Uniflow Gallery swipe 0 Answers

2D physics jump issue. 1 Answer

Climb animation in Update or FixedUpdate or LateUpdate?, 1 Answer

Slow motion all but one - yet another round, hopefully the last 6 Answers

Rigidbody2d.MovePosition on Update vs FixedUpdate 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