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 estefanowolf · Nov 20, 2014 at 05:41 PM · physicsraycastinginput.touchtimestep

Fast Tapping Objects.

Hello, i am working on a game in which the objects are falling at a high speed and i tap the objects with input.touches with raycasting and destroy them. the objects have 2d colliders. the problem is that raycasting works on normal speed but at high speed the touch is not detected. i have searched everywhere and thought it was touch problem but then i have come to a conclusion that the physics frame rate is not fast enough for touch to detect colliders. i tweaked with the timestep in the time manager, but it still doesn't help me enough.

Comment
Add comment · Show 4
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 MrSoad · Nov 20, 2014 at 05:28 PM 0
Share

Have you tried changing the interpolate settings on the rigidbodys?

$$anonymous$$ovement can be a bit quick and jerky from one FixedUpdate() to the next, but this will smooth the movement across the frames that occur in between, and may help sort your problem as a result...

avatar image MrSoad · Nov 20, 2014 at 05:40 PM 0
Share

Ah, I was thinking maybe the raycast was missing the collider in between FixedUpdate()'s...

Do you handle the touch in Update(), input is normally frame rate dependent, even though you have to run the physics in FixedUpdate()...?

avatar image MrSoad · Nov 20, 2014 at 05:54 PM 1
Share

$$anonymous$$ust admit I'm at a loss too, I will get back if I think of anything useful... :(

Do you do your raycast in Update()? Just though you could maybe set a touched bool to true(in Update()) then pick this up and raycast in FixedUpdate() (when it is true), if you get what I mean...?

$$anonymous$$ight be worth a quick try...

avatar image MrSoad · Nov 20, 2014 at 06:02 PM 0
Share

Try the raycast in FixedUpdate() and see what happens.

1 Reply

· Add your reply
  • Sort: 
avatar image
3

Answer by vptb · Nov 20, 2014 at 06:15 PM

Are you trying to do something like the mobile game "Piano Tiles" (http://www.youtube.com/watch?v=HR8PNyTPpMo#t=55)?

Some time ago I tried to replicate that game and I found the exact same problem that you're facing, I tried several solutions and the best one that worked very good was to move the colliders, let me explain better.

In that game the objects (and their colliders) are moving down, and later in a play they will move really fast, what happens in Unity is that the touch is registered, but when you it tests if it hits a collider, the collider isn't there any more. So the solution I found was to move the center of the colliders upwards in relation to their speed. So basically in a low speed they will be centered on the object, but as the speed increases they start to move up, making it so that when the device detects the touch, it will still hit the collider.

Your game might be a little different, but you can try the same approach.

Comment
Add comment · Show 1 · 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 MrSoad · Nov 20, 2014 at 06:25 PM 0
Share

Sounds like a good idea to me :)

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Raycast not applying force to point 1 Answer

Direction/Hit Detection without triggers. 1 Answer

"Fast" fixed timestep 1 Answer

Projector with collision detection 1 Answer

Using Raycasts to change the X and Y position of a moving GameObject? 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