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 Blixia · Feb 19, 2015 at 05:32 AM · animation2dmovementanimator

Animator behaviour on GameObject

Hello,

I am completely new to unity/game development and stumbled on a small problem I can't figure out.

I have a GameObject and I applied a Sprite to it. I gave it 2 Collider's, circle & box as a tutorial, spaceship 2d from unity. I added a Script to it to let it move.

 void FixedUpdate()
 {
     float move = Input.GetAxis("Horizontal");

     rigidbody2D.velocity = new Vector2 (move * maxSpeed, rigidbody2D.velocity.y);
 }

Which moves the GameObject to left or right.

But when I add an Animator I can't move it anymore. Why does the Animator prevent the moment?

Also I noticed that when I added the Animator is that where I place the GameObject on the scene is not where the GameObject starts when I preview the game? I kind of teleports to the left side of the scene. Like It has a fixed position or something.

I tried using the Animator update mode 'Animate Physics' but then I will only move within a few pixels form itself.

Hopefully I am clear enough

Thanks in advance.

Comment
Add comment · Show 2
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 Blixia · Feb 18, 2015 at 07:27 PM 0
Share

@tanoshimi I have these settings: http://s28.postimg.org/5qc3hwi4d/animator.png

avatar image meat5000 ♦ · Feb 20, 2015 at 01:10 AM 0
Share

Try baking movement in the import for the model.

You can 'override' Animator by either using LateUpdate or OnAnimator$$anonymous$$ove to perform movement.

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by toddisarockstar · Feb 20, 2015 at 04:47 AM

thats odd , the animator shouldnt override movement. i think I may have had this problem once though because 3dmax impored without a proper parent. the animator does contain positions for the objects and its children. maybe the animator is relating positions to world space. so here is how i fixed...

create a new empty game object. (if your new, click on the gameobject tab on the very top menu bar). Rename it as whatever name you want to call your object.

drag and drop your actuall object into the new empty. add your movement scripts to only the newly named empty which represents your object now.

if your animations are reasigning to world space, this would fix the problem. other than that.... there is no other reason why an animator would have anything to do with movement!

I hope this works for you.

btw... this technique works well for other weird fbx inport /export setting such as charaters importing upside down.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

2D Animation does not start 1 Answer

Animator warning in editor, animation is preventing script from working 1 Answer

Animation Lag when Changing Movement Direction 2D (4.3) 2 Answers

SpriteManager 2 1 Answer

Best way to do animate soldier? 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