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 Paul_BadBoy · Jul 07, 2014 at 05:39 PM · c#camerajavascriptconnection

Connection between 2 scripts

I need to connect the script that adds touch controlls on the camera to the script that controlls the vehicle, but I didn't find anything useful... Can you help me, please?

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 robertbu · Jul 07, 2014 at 05:45 PM 1
Share

By GetComponent:

http://docs.unity3d.com/412/Documentation/ScriptReference/index.Accessing_Other_Game_Objects.html

http://unitygems.com/script-interaction1/

By Events and Delegates (C# only):

http://answers.unity3d.com/questions/600416/how-do-delegates-and-events-work.html?sort=oldest

By Send$$anonymous$$essage:

http://docs.unity3d.com/ScriptReference/GameObject.Send$$anonymous$$essage.html

avatar image Paul_BadBoy · Jul 07, 2014 at 06:06 PM 0
Share

do you happen to know how can I see which part of the script is doing the action when I press a key?

avatar image gjf · Jul 08, 2014 at 09:32 AM 0
Share

vague questions make it impossible for people to help you. be as specific as possible and remember to use code tags when posting code.

try posting the code that you've tried - people generally help fix problems, not write it all for you...

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Grim_Darknight · Jul 08, 2014 at 09:44 AM

Create a variable of the vehicle controler's type in the touch script and assign the vehicle control script to that:

 public class Vehicle_CTRL : xxxxxxxx
 {
 /*
 Stuff
 */
 }
 
 public class Touch : xxxxxxxx
 {
 
 public Vehicle_CTRL vehicle;
 
 /*
  Stuff
 */
 }

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

22 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

Related Questions

Help in Multiplayer 2 Answers

Camera switching : C# onTriggerEnter not working 1 Answer

How do I make a strategy camera go up and down? 1 Answer

Isometric camera skybox not working. 0 Answers

Objectives based on object appear. 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