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 /
  • Help Room /
This question was closed Oct 28, 2015 at 12:59 PM by EnesShahn for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by EnesShahn · Oct 27, 2015 at 09:27 AM · animation

Coroutine Animation

soo i have 2 cubes and i want to make animation by using Vector3.Lerp so the cube 1 will go Lerp to cube 2 and if both in same place set touched var to true. so i typed this :

 IEnumerator PlayAnimation()
 {
 while(//cube 1.position != cube 2.position//)
 {
 //lerp Cube1 to cube 2 
 yield return new waitforseconds(0.01f);
 }
 //then here i want to check if they are in the same place and if soo then set the touched varible to true
 if(//cube 1.position += cube 2.position//)
 {
 touched = true;

yield break; } }

but the if statement doesnt work ...

Comment
Add comment · Show 3
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 OctoMan · Oct 27, 2015 at 09:30 AM -1
Share
 if(cube1.transform.position == cube2.transform.position)

Try that for the if statement.

avatar image OctoMan OctoMan · Oct 27, 2015 at 08:56 PM 0
Share

Are they ever 100% on the same position?

avatar image EnesShahn OctoMan · Oct 27, 2015 at 10:53 PM 0
Share

yup i even tried with trigger

1 Reply

  • Sort: 
avatar image
0
Best Answer

Answer by EnesShahn · Oct 28, 2015 at 01:20 AM

Solved!!! it was simple this is what i did:

 IEnumrator PlayAnimation()
 {
 while('the twocubes doesnt touch each other')
 {
 //move the cube 1 to cube 2
 //then  repeat it until they touch
 }
 //what i type here will excute after while statment = false
 //soo simply 
 touched = true;
 }
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 EnesShahn · Oct 28, 2015 at 12:59 PM 0
Share

wow my problem solved xD

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

3d animation breaking 0 Answers

How do I make an animation activate by clicking the mouse button in unity5? 0 Answers

Open Door Animation Problem 0 Answers

why do animated objects not behave like normal GameObjects? 0 Answers

Attach more than one skinned meshrenderer to same animator. 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