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 Moubien · Feb 01, 2017 at 09:14 PM · animationandroidtouchscreen

Animation issue related to touch input on phone

Hi I'm using this piece of code for animation within my condition : animator.SetInteger("STATE", 1); when I test this on my pc within this code : if(Input.GetMouseButtonDown(0);){ //code } everything is fine but when I test it on my phone the animation wont work unless I hit twice which means I meet the condition twice is there something wrong related to animation when running on phone? because I tested this on many phones it's the same issue but on the PC nothing wrong at all also I used the touch code
if (Input.touchCount > 0) {

         if (Input.GetTouch(0).phase == TouchPhase.Began)
         { }
     }

the same result any help please?

Comment
Add comment · Show 10
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 HgM3rK · Feb 02, 2017 at 12:02 AM 0
Share

Are you doing this in FixedUpdate, or Update?

Reading Input in FixedUpdate can cause Input Loss.

is it always twice?

avatar image Moubien HgM3rK · Feb 02, 2017 at 06:52 AM 0
Share

it is in the (update) this is a part of my code: bool $$anonymous$$ouseDown = Input.Get$$anonymous$$ouseButtonDown(0);

     if (num_bullet>0)
     {
     if (corner.transform.eulerAngles.z > 1 && corner.transform.eulerAngles.z < 180)
     {
        
                 if ($$anonymous$$ouseDown)   //$$anonymous$$ouseDown
                 {
                     if (num_bullet != 0)
                         num_bullet -= 1;
                     if (corner.transform.eulerAngles.z > 1 && corner.transform.eulerAngles.z <= 30)
                     {
                         **animator.SetInteger("STATE", 1);**
                         ShootBullets(bullet, spawnpoint1);

                     }

the animation part is what having the problems the shooting have no issues and this only happening on the phone on the PC it's totally normal. and Yes it needs to meet the condition twice to set the animation correclty the first shooting wont set the animation to where to should unless I hit again

avatar image HgM3rK Moubien · Feb 02, 2017 at 03:22 PM 0
Share

Have you made 100% Sure the input is not read on the first "Touch" ?

By Debug.Log();

Aside from that, I don't see why the animator should be a problem if the only difference is the Platform.

Here are a few things I found

"animate only if visible was set to true."

What version of Unity are you using? I found this on internet. """ Thank you for taking the time to report this issue. I have been able to reproduce this bug, however it is not reproducible in 5.4, which means that the bug is fixed. If, when that version comes out, you are still able to reproduce it, or have any questions, please contact us again.

Regards, Benediktas Unity QA Team"""

These might be relevant http://answers.unity3d.com/questions/771991/animator-state-not-found-in-ios-build-only.html

http://answers.unity3d.com/questions/1137768/objects-with-looping-animation-disappear-in-ios-bu.html

https://www.google.ca/search?q=Unity3D+IOS+animator&rlz=1C1CHBF_enCA692CA692&oq=Unity3D+IOS+animator&aqs=chrome..69i57.5888j0j7&sourceid=chrome&ie=UTF-8

For the Best!

Show more comments
avatar image Moubien · Feb 03, 2017 at 07:11 AM 0
Share

the animation is not working at all within unity remote

avatar image Moubien · Feb 03, 2017 at 07:51 AM 0
Share

I have it already and it's even more messed up when I run it on the remote there is no response for the animation at all

avatar image HgM3rK Moubien · Feb 03, 2017 at 03:47 PM 1
Share

What version of Unity are you using? Did You debug Log the state of the Touch input to figure out if first touch works or not.

read this. http://answers.unity3d.com/questions/1143208/objects-with-animationanimator-is-not-showing-up-i.html

avatar image Moubien HgM3rK · Feb 03, 2017 at 03:49 PM 1
Share

Thank you for your advices I used the unity remote along with the debug and I was able to find the issue and I got it sorted thx a lot.

Show more comments

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

7 People are following this question.

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

Related Questions

how can create touch screen android scroll in unity3d? 1 Answer

left and right buttons for android 2d game 1 Answer

Can the animation editor create local rotational data? 3 Answers

Something funny that I don't know why 0 Answers

Animator.Update High CPU Usage on Unity 5 resulting in bugs on Android 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