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
1
Question by Xdy · Mar 16, 2013 at 10:42 AM · gravityfloatscrpt

.cs and .js can work together but..

In my case for example I have .cs on my player and .js on my car suppose when I hit "E" button the camera change from player to car as im inside. I cant prove this yet because at the moment my car float as there a wind blow and I believe to be problem with the tyre script or export. In the other scene that has proven work, the player and the car is fully .js I wonder if anyone know .js and .cs can collaborate together to give me passion know that this will work and would be helpful if you know how to solved the floating issue should it be easy

email : removed

Comment
Add comment · Show 1
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 Seth-Bergman · Mar 16, 2013 at 10:45 AM 1
Share

don't post your e-mail on a public forum unless you are addicted to $$anonymous$$ALICIOUS SPA$$anonymous$$!

you can use both .js and .cs in a single project, but it only goes ONE WAY, they can't talk back and forth

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Seth-Bergman · Mar 16, 2013 at 10:50 AM

you can use both .js and .cs in a single project, but it only goes ONE WAY, they can't talk back and forth

to make this work you would put the one to compile first in a folder which will compile first:

http://docs.unity3d.com/Documentation/ScriptReference/index.Script_compilation_28Advanced29.html

for example, you can put your C# files in a folder called "Plugins" inside your Assets folder.. then, the .js scripts will be able to see them. BUT, the C# scripts will NOT be able to see the javascript.

Do yourself a favor and just pick one language, you can only use the other if you know it only goes one way

Comment
Add comment · Show 6 · 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 Xdy · Mar 16, 2013 at 11:05 AM 0
Share

thx Seth for re$$anonymous$$der

Seems to me my car is .js and I have to change it to .cs too now because even if this different script work I can only change camera from player to car but cant back to player I guess.

I cant convert it though that meant I probably revamp a new car script hopefully no wind floating will occur to the car object.

avatar image Seth-Bergman · Mar 16, 2013 at 11:15 AM 0
Share

cars are tough, keep at it!

you should be able to convert .js to .cs pretty easily, all you do is:

 change the word "function" to "void"

 change var declarations from "var myVar : Type;" to "Type myVar"

 add the "new" keyword for any RECTS (such as in GUI) and VECTOR 3's 

 fix any yield statements (pain)

and if there are STILL errors...

good luck!

avatar image Xdy · Mar 16, 2013 at 11:20 AM 0
Share

Yes they are

Thanks for that because the .js script is good and theres no ready made .cs that can function the same so converting is a preferable at the moment and I will try

avatar image Seth-Bergman · Mar 16, 2013 at 11:24 AM 0
Share

try your best and if all else fails post your best effort in another question, you will probably get help if you can get close on your own!

(also, if an answer solves your question,please be sure and accept it by clicking the check mark! thanks!)

avatar image Xdy · Mar 16, 2013 at 11:38 AM 1
Share

Yes I will

Now I learn to checkmark an answer thanks

will try to do that on my previous post when I have the time

Show more comments

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

11 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

Related Questions

How to edit scene gravity? 0 Answers

Player flies up into the air when walking 3 Answers

Can I emulate simple space-like gravity? 2 Answers

Change controller gravity below a certain level? 0 Answers

Game Object floats away 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