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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by IKilledKenny_2 · Dec 30, 2014 at 08:08 AM · animation

Change Animation Position When I Press Button

Hello Unity3D i have a question about animation positions?.How can i make it that whenever i play an animation my 3d animation moves forward like 3 steps?For example.Whenever i press the punch key my character does the punch animation but stick in the same spot.What i want is that whenever i click the punch key the punching animation moves for 3 steps.If anyone knows how i can do this.Can you please tell me how?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Inok · Dec 30, 2014 at 11:32 AM

Most likely you need to activate Root Motion

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 IKilledKenny_2 · Dec 30, 2014 at 05:49 PM 0
Share

does this work with legacy?

avatar image
0

Answer by Qasem2014 · Dec 30, 2014 at 06:43 PM

1 - why you write your question like code ? edit it :D

2 - you should put your character in another (empty) game object ! then modify your code like this :

if user press punch key do the animation and do this on your empty game object :

 emptygo.GetComponent.<Rigidbody>().velocity = emptygo.transform.TransformDirection(Vector3(20 , 0 , 0));

this code make your character go ahead ! emptygo is your empty game object . its a variable of GameObject type :

 var emptygo:GameObject;

please notice that you maybe should modify << Vector3(20 , 0 , 0) >> . search for it if you don't know whats this !

Comment
Add comment · Show 4 · 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 IKilledKenny_2 · Dec 30, 2014 at 08:50 PM 0
Share

Sorry i dont know why it does that sometimes...D=.And im going to give this method a try right now =D

avatar image Qasem2014 · Dec 30, 2014 at 09:45 PM 0
Share

you select the text and click on 101010 button :D 101010 button make your text like codes :D

avatar image IKilledKenny_2 · Dec 31, 2014 at 02:47 AM 0
Share

Thanks i fix that problem.But with your script my character moves tot he side i want it to move forward is there a way to do that?

avatar image Qasem2014 · Dec 31, 2014 at 10:46 AM 0
Share

change Vector3(20 , 0 , 0) to Vector3.forward !!

read this for vector 3 !

AND maybe you should add velocity force to character directly ! test your script for empty game object and character , both :)

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

27 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

Related Questions

A node in a childnode? 1 Answer

Maya animations not playing in Unity 3 correctly 0 Answers

Using AnimationClip.SetCurve on child object. 0 Answers

Unity 4.5.2 bug changing the properties of the 2d colliders in animation 1 Answer

why does the animation looks different when imported into unity 2 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