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 /
  • Help Room /
avatar image
0
Question by Kinkladze11 · Oct 10, 2015 at 03:50 PM · physicsinputitween

List of gameObjects unresponsive to fast button presses

Hi Y'all,

I hope I can explain this issue clearly...here goes :)

I have 4 rows of 10 objects (hoops). Some rows move from left to right on the X axis and others vice versa.The hoops contained within each row are stored in their own individual list.

What I need is for the hoops to move by -80 units upon pressing the jump(space) button. I am using this code (inside Update) in order to achieve this :-

 //MOVE HOOPS ON Z AXIS WHEN JUMP IS PRESSED
 if (Input.GetButtonDown("Jump") && BallCollision.isGrounded == true)
 {



     foreach (GameObject hoop in hoopList)
     {


         if (hoop.transform.position.z > -85)
         {


             //MOVE GAMEOBJECT SO RESPAWN HOOPS APPEAR ON CORRECT ZPOS
             hoopsinZmove = true;

             //MOVE ROW (LIST OF HOOPS) TO CORRECT ZPOS
             iTween.MoveBy(gameObject, iTween.Hash("z", -80, "time", 0.4f, "easetype", iTween.EaseType.linear));

             //STOP HOOPS X MOVEMENT PRIOR TO APPLYING ITWEEN Z MOVEMENT
             Rigidbody thisRb = hoop.GetComponent<Rigidbody>();
             Vector3 stopxMove = new Vector3(0, 0, 0);
             thisRb.velocity = stopxMove;

             //MOVE EACH HOOP IN ROW TO CORRECT ZPOS
             iTween.MoveBy(hoop, iTween.Hash("z", -80, "time", 0.4f,
                 "easetype", iTween.EaseType.linear, "oncomplete", "HoopMoveOver"));




         }



     }

As you can see, i'm using an itween to move the hoops and to be honest this code works fine as long as there is a gap of about at least half a second between button presses.

The problem arises when I begin pressing more quickly. Most of the rows of hoops move on the Z axis as intended however one of them (different row each time) usually doesn't respond.

If anyone can shed any light on this then would be extremely grateful.

Thanks in advance :)

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

0 Replies

· Add your reply
  • Sort: 

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

32 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

Related Questions

Make character follow cursor movement and detect collision 0 Answers

How can I animate my 3D object without affecting the physics? 0 Answers

Setting positions of points on Line renderer to mouse position does not work 1 Answer

Physics-related touch input (Continuous) 0 Answers

How to handle FixedUpdate() and Input 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