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 /
This question was closed Jan 26, 2016 at 11:19 AM by Daniel_Zabojca for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by Daniel_Zabojca · Jan 04, 2016 at 11:00 AM · animator controllerbutton trigger eventsevent triggeringanimationeventmouseover

How to make a lot of simple interaction that triggers a lot of animations?

Hello everyone!

I got a question.

I want to make a game where you walk in a building and you can interact with a lot of objects. Lets say I have a room with a few objects like a trashcan, door, few bookcases etc. I want to make them play an animation when I have my mouse on them (hover maye?) and then press E button on my keyboard, and when i do, then the object that I have my mouse on plays an animation, and stays on the end (like open a chest, and the chest stays open, and to close I have to press E again on the chest.) (something like an RPG game) I am making an RPG game by the way, if that is needed to know to help solve this problem.

How can I script it the best way? And how do I assemble the animator the best?

Thank you all in advance,

Daniel Nowak Janssen.

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

  • Sort: 
avatar image
1
Best Answer

Answer by LMan · Jan 04, 2016 at 02:32 PM

One way you could do it:

Each object needs an animator controller of it's own that will function as it's state machine. the animator controller will contain boolean variables that will control which animation gets played when the object is interacted with.

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 Daniel_Zabojca · Jan 06, 2016 at 08:20 AM 0
Share

Thank you!

I got it working somehow. Do I need to make for each animation another state machine and animator controller? or can I put the same animator controller on each object that I want to animate? Because now I made an animator and animation on a dresser, and when I press the opening button the dresser opens, and I can pick a piece of cloth out of it with the interaction button. And when I press the opening button on the dresser it closes.

But I was wondering if I can use the same animator controller on more objects, with each another animation... It won's cause a lot of errors right?

avatar image LMan Daniel_Zabojca · Jan 06, 2016 at 02:14 PM 0
Share

If you want different animations you're going to need to make separate Animator Controllers I'm afraid. I would recommend making copies of your animator controller file in the project folder and then changing the motion fields of the states in the copies to point towards the animations you want.

That way you keep the state machine the way it is and don't have to set up the bools or change any scripts.

avatar image Daniel_Zabojca LMan · Jan 07, 2016 at 09:27 AM 0
Share

I got a quick question, How can I freeze the camera on interaction? So I press E and I start an interaction, and I want the camera to freeze on that position. So like this : Press E, open door & camera rotation and position freeze, animation en & camera rotation and position unfreeze.

How can I achieve that?

Thank you again for your help and have a nice day @L$$anonymous$$an,

$$anonymous$$ Nowak Janssen.

Follow this Question

Answers Answers and Comments

33 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Transform Of GameObject getting changed incorrectly after updating RuntimeAnimatorController 0 Answers

How do I keep scroll rect working with custom pointer events? 1 Answer

How to detect if UI button is clicked? 3 Answers

Mecanim Animation events fires multiple times 1 Answer

Animation Plays well,but teleportation effect happens briefly when parenting the object to other obj 0 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