• 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

1 Reply

· 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.

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

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

shooting animation while aiming not working? 1 Answer

how to make a door slide open 1 Answer

Character changing its orientation randomly while calling the animation through scripting 0 Answers

play animation sequence 3 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges