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 Kade514 · Feb 17, 2017 at 04:55 AM · animationtransformparentingincorrectly

Game-view and run time editor are displaying animation but the projectile is spawned as if AI was in T-pose

Hi all,

I've been trying to make an AI archer for my game and it's been going well except for one annoying problem. Basically, while both the game-view and runtime editor views are showing the AI behaving correctly and animating properly when the AI attempts to release the arrow they've drawn back, the arrow has its position and rotation set to those of the AI's right hand as if the AI were in a T-pose.



The arrow is spawned using this interface:

 public virtual void CreateArrow()
     {
         if (m_AIController != null)
         {
             m_NewAttack = Instantiate(arrowPrefab, m_AIController.projectileHolder.transform.position, Quaternion.identity, m_AIController.projectileHolder.transform);
             m_NewAttack.transform.localRotation = Quaternion.Euler(0, 0, 0);
             print("Create Pos: " + m_AIController.projectileHolder.transform.position);
         }
 
     }


The arrow launches itself using this interface:

 public virtual void Fire(Transform holderTrans)
     {
         print("Fire Pos: "+holderTrans.position);
         GameObject sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere);
         sphere.transform.position = holderTrans.position;
         sphere.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f);
         m_ThisRB.isKinematic = false;
         transform.parent = null;
         transform.position = holderTrans.position;
         transform.rotation = holderTrans.rotation;
         m_ThisRB.AddForce(transform.forward * velocity, ForceMode.VelocityChange);
     }



The reasons I suspect that the system acts as if AI is still in a T-pose is thanks to the evidence produced by two scripts I made. The first script spawns a sphere at the same position the arrow will be given when the AI releases their arrow (andis the one active in the video linked below) and the other spawns a sphere at the same position every 0.2 seconds. In both cases, the system spawns spheres at the position the arrowHolder object would be in if the AI were in a T-pose.

Video of bug in action


The animations and avatars I'm using are all set to humanoid and were gotten from Mixamo so they should all be set up correctly already though I may have missed something important.

I'm really hoping that someone can help me identify why this issue is occurring as it's really annoying me and I have very little experience with animating things so I'm pretty much entirely stuck.

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
0
Best Answer

Answer by Kade514 · Feb 19, 2017 at 02:42 PM

The problem was being caused by me calling methods prior to the IK pass. Changing my methods to accommodate the IK being done resolved the issue.,

Comment
Add comment · 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

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

178 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 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 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 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 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 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

Syncing character animation with game object's local transform (SOLVED!) 1 Answer

Animation sprite changing but not position 0 Answers

Stripper Pole Animation Problem 1 Answer

Getting NaN on iOS when using animation. 2 Answers

Animation of an obgect transform according to it's change 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