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 n11yr42 · Apr 14, 2012 at 08:42 PM · runtimeanimationcurve

How to modify animation curve in run time?

I have a model. When he play "shooting", I want to modify animation keyframe to make he's arm can follow target.How do I do?

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 JayMHelpsU · Apr 14, 2012 at 09:52 PM 0
Share

Could you please elaberate more one which target you are want the arm to follow, where is the target, what is the arms purpose, how fast is this all meant to happen. If you have any current code if you could post it that would be great, Thanks in advance :)

avatar image n11yr42 · Apr 14, 2012 at 10:33 PM 0
Share

The model is enemy. The target is player.When he attack player, he will raised his gun and shooting. I want to control his arm rotation to aim player. I try to rotate arm's bone, but it is difficult. The animation hinder me to rotate it. So I think maybe I can modify the shooting animation final keyframe in run time. That will be easy more, but I don't know it can do or not. $$anonymous$$y English is not good, sorry.

avatar image JayMHelpsU · Apr 15, 2012 at 06:14 AM 0
Share

It's fine, as long as you can type in a language i understand then theres no need for appologies. You can try making the enemy constantly looking at the player, which can be found in this youtube series. http://www.youtube.com/watch?v=jN3XCOl$$anonymous$$ZsU Hope this helped :)

avatar image Paulius-Liekis · Apr 17, 2012 at 10:23 AM 0
Share

Guys, please post answers as answers, not as comments.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Paulius-Liekis · Apr 17, 2012 at 10:22 AM

You don't need to modify animation curve for that. Simply change tranform position/rotation values in LateUpdate call, this will override your main animation.

http://unity3d.com/support/resources/example-projects/3rdpersonshooter is a good resource to learn more about animation control.

Comment
Add comment · Show 2 · 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 pointcache · Jan 30, 2013 at 12:29 PM 0
Share

and nobody answered the question. How to modify animation curve in run time?

avatar image Paulius-Liekis · Jan 30, 2013 at 01:13 PM 0
Share

You can use AnimationClip.SetCurve and http://docs.unity3d.com/Documentation/ScriptReference/AnimationCurve-keys.html to modify animations and curves at runtime.

avatar image
0

Answer by Varaughe · Oct 12, 2013 at 08:11 AM

I do think, you'll need to have two animations very similar,and try to blend between them at runtime so that your character to follow your target... otherwise to change at runtime an animation clip ,seems rather impossible ...

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

9 People are following this question.

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

Related Questions

How to access AnimationCurve at runtime 4 Answers

C#: read text file and interpret as script at runtime? 1 Answer

scripts not working at runtime? 1 Answer

runtime: script variable not processed as demanded 1 Answer

How to create animations via script. 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