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 t0n1s · May 30, 2013 at 04:56 PM · animationmenuclick

Camera changes position when click on 3D text

Here is what i have. I have a main menu that looks like this alt text

So i want when i click on the text "OPTIONS" the camera to move over to the table. I have already made the animation and here are the scripts i use.

function OnMouseUp() { transform.animation.Play("Camera"); }

i use this code in the 3d text but it changes the position of the text not the camera's. I think i have to put a reference to the Main camera on the 3d text script. Anyone can help ?

1.jpg (136.8 kB)
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
0

Answer by Stormizin · May 30, 2013 at 05:03 PM

You just can use this:

 public void CameraMove(){
 if(Input.getKey(1)){
 Camera.maincamera.transform.Translate(Vector3.foward);
 }
 }

The ideia is: You can just use translate every click to go foward into table and back to the original position.

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 t0n1s · May 30, 2013 at 05:45 PM 0
Share

No it doesn't work. I think you didn't get what i want to do. I have the animation where the movement is from the spot we are to over the table i need to make the animation play on the camera not the 3d text. When i hit click on the "Options" the 3d text plays the animation ins$$anonymous$$d of the camera. If it helps this the script i have in the 3d text function On$$anonymous$$ouseEnter() { //Change the color of the text renderer.material.color = Color.red; }

function On$$anonymous$$ouseExit() { //Change the color of the text renderer.material.color = Color.white; }

avatar image
0

Answer by t0n1s · May 30, 2013 at 08:10 PM

Oh nevermind, i added a box collider in the main camera moved it in the position of the 3d text and used the codes

 function OnMouseUp()
 
 
 
 {
 animation.Play("Camera");
 }
 
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

14 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

Related Questions

Playing different button animation after first animation plays 1 Answer

How to play sprites animation on the place that we click? 0 Answers

How To Play Animation On UI Button Click Please... Im Going To Freak Out Please Enter And Help Me 2 Answers

UNITY 2D: How to make a level selection menu (like the video in details)? 1 Answer

How can I stop an animator playing 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