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 Darwin Mecharov · May 09, 2014 at 04:14 PM · animationtransformpositionbobbing

In animations, is it possible to only add transform values instead of setting it?

Hello guys! There's a problem with an animation I made in Unity itself. I made a "bobbing" animation for my camera as the player walks but, it doesn't work as expected. It only plays the animation at the specific transform position values I put. What I'm trying to do is to add transform position values instead so that it gets to follow the player and doesn't get left behind. Is it possible? Or am I doing something wrong? Here is a picture of the problem in case you don't fully understand...alt text

animproblem.png (472.9 kB)
Comment
Add comment · Show 1
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 Braintaker2 · May 09, 2014 at 04:54 PM 0
Share

im not really sure im also having the same problem hope someone finds out!

2 Replies

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

Answer by Key_Less · May 09, 2014 at 05:27 PM

This is a pretty common issue. Your animation is effecting your camera's transform relative to it's global coordinates. In other words, it will always animate from the same spot relative to the world position of (0,0,0).

All you need to do is make the camera a child of an empty game object and set the camera's position to (0,0,0), this way it will always animate relative to it's parent's position. Then you can update the empty game object's transform to follow the player and your camera will move with it, while animating.

Alternatively, you could attach the camera to your player object, and offset the camera's position, in which case the camera will always follow the player. With this approach, you'd only need to worry about updating the player's position and the camera will inherit the changes. There is a simple example script of this on the Unity reference pages here.

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 Darwin Mecharov · May 10, 2014 at 02:32 AM 0
Share

Thanks for your help, I'll be trying it right now.

avatar image Darwin Mecharov · May 21, 2014 at 08:06 AM 1
Share

Sorry for the late answer accepting, was busy doing something else :p

avatar image
1

Answer by Paulo33 · May 09, 2014 at 05:34 PM

Just Create a Empty object and child the camera.

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

23 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

Related Questions

My child move with the parent but can't move on it when the parent is moving 3 Answers

Animation won't play when changing position 0 Answers

Having issues with position in my animation 1 Answer

What is causing my attack animation to be in a different position from my idle/run animation? 0 Answers

Cinema 4d to unity (Transform/position) 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