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 sayurta · Nov 04, 2010 at 04:21 PM · animation

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

Hi everybody. I need some help, i have been looking around for the answer but can't figue it out. I made some turtles, they have a walk animation but they dont move foward, so I attached a Move Foward script. Everythig right, but now I need that both animations starts only when the player (FPS) puts an object (A magic stone) on it's place (a magic totem). I have tried On trigger enter or, On trigger exist but is difficult to me realize how can i connect all the parameters in order them to work perfectly.

Thanks a lot!!!!!!

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 skovacs1 · Nov 04, 2010 at 04:25 PM 0
Share

Please post some of your script.

avatar image sayurta · Nov 05, 2010 at 04:23 PM 0
Share

It is really a very simple one, and i put it in order that my turtles move foward. The animation is set as play automatically:

private var myTransform : Transform; function Awake () { myTransform = transform; }

function Update () { myTransform.Translate(-0.05, -0.005, 0.006); }

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by IceCreamTruck · Nov 05, 2010 at 01:30 AM

Okay. I'm guessing your problem is, you have multiple scripts and within each scripts, there are functions you'd like to call? Like skovacs has commented, you might wanna post your script because we can't really see what's going on here.

But, if I guess correctly, this might help you a bit..

Your character have an animation you wanna play, let's say animation01. Create a function inside the script (let's say the script name is charScript) attached to your character to play this animation, something like this,

function PlayThis() { animation.CrossFade("animation01"); }

Now, when you want to access this, depending on from where you wanted to access it, either use

GetComponent("charScript").PlayThis(); - if the two script are attached to the same game object

or

GameObject.Find("theNameOfYourGameObject").GetComponent("charScript").PlayThis();

Hope this helps :)

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 sayurta · Nov 05, 2010 at 04:26 PM 0
Share

Thanks Im gonna work with that!!! Hope I can figure it out!!

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

No one has followed this question yet.

Related Questions

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

Animation On Button Press 3 Answers

Animation by Scripting point A to B 1 Answer

Animating (simple rotation) armature by script 1 Answer

How to create an animation hands (or script) to pick-up a cup from the table in 3ds max or maya or from direct unity! Please help!! 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