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 /
avatar image
1
Question by Oudaiesty · Feb 26, 2010 at 02:51 PM · animationevent-handling

How do you make an animation start from a location dynamically?

So far I have it set up so that when the player hits a collider trigger placed at the end of a course a "Goal camera" is enabled and it was set up to look at the target at the end of course before it was hit. It's position changes to follow the position of an empty Game object which has an animation attached to it so the camera snaps to the empty objects position and moves along the animation path.

My main problem is how can I get the empty object (Which I will now call camera helper) to start its animation from the point that the player hits and then move to the location of the animations path and then play the animations path. I was thinking about using a Lerp but thats all I can think of... I'm still working on figuring out what everything does its a bit overwhelming occasionally haha.

The steps so far: - player has a camera follow them to the end of course - player hits a collider trigger - the trigger is supposed to turn on a secondary camera -that camera is supposed to start from the players position and then move to follow the path of a preset animation.

Any advice so far?

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

Answer by runevision · Feb 26, 2010 at 03:20 PM

When you animate a position of a GameObject, it is actually the local position you are animating, not the global position.

Make a new GameObject and make CameraHelper a child of that. Now move the position of the parent GameObject before you start the animation of CameraHelper. It will play the animation relative to the position of the parent GameObject.

Comment
Add comment · Show 3 · 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 Oudaiesty · Feb 26, 2010 at 05:38 PM 0
Share

Oh wow thats a really good idea, Thank you very much for your help!

avatar image Oudaiesty · Feb 26, 2010 at 06:09 PM 0
Share

Alright that works but now I want to set the location of the new game object to be equal to the point of contact at the time the game object hit the box collider.

$$anonymous$$inda like (for Example) if I cross a finnish line the camera animation will start from the exact point that I crossed the line.

avatar image Oudaiesty · Feb 26, 2010 at 06:44 PM 0
Share

Okay I got it to work, Thank you very much now I can move on to other parts of the process.

avatar image
0

Answer by gitsU · Mar 19 at 08:52 AM

I know It is literally more than 12 years later, but this reply saved me from doing some really complicated script animation, thank you so much

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

1 Person is following this question.

avatar image

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Activating an Animation? 2 Answers

Player Animation and control panel 2 Answers

How can I make that two events starts when something else happens? 1 Answer

Play animation for horizontal and vertical movement? 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