|
Hi Does anybody know if I can get the 3rd person camera and controllers that ship with unity in c#. Eventually I will create my own but I would like to use the one that ships with unity for a quick prototype. I've made an on screen thumbstick that holds its own axis values so I need to modify the script so that it takes my thumbstick axis values instead.
(comments are locked)
|
|
I don't believe someone have translated both scripts to C# - they are too complex, and the translation would be a typical too pain, no gain case. But you can modify the ThirdPersonController.js script to use your thumbstick: 4- Locate the two lines below: and change them to: This is enough to do the basic movements with your thumbstick, but doesn't include the Shift or Jump keys - you must use the keyboard shift and your thumbstick to make the character run, and the Jump key at the keyboard to make it jump. If you have equivalents to these commands in your thumbstick, use the same logic to implement them in the ThirdPersonController (search for Input.GetKey for the shift, Input.GetButton for the jump). Hi aldonaletto. I understood which values to change but I think I got confused with which way round my unityscript and c# scripts could communicate. I thought it was the other way round so thanks for that :)
Jul 15 '11 at 12:05 PM
Blankzz
Just a quick question. Shouldn't I need to put the class name before the axis values to access them and do they have to be static for them to be accessed?
Jul 15 '11 at 12:28 PM
Blankzz
1- Communication between JS and C# is a problem because they do not "see" each other at compiler time. Once compiled to CIL (the .NET Commom Intermediate Language), however, their static variables become visible to other scripts not compiled yet (maybe static functions too, but I'm not sure). Since you've placed your C# script in a non-standard folder, it will be compiled last, what enables it to "see" the static variables of all already compiled scripts - no matter if C# or JS (or Boo, if someone in this planet use it). But the already compiled scripts don't see your script, so this is a one-way communication line.
Jul 15 '11 at 03:02 PM
aldonaletto
Thanks again. I appreciate your detailed answers. Makes sense to me now. I think developers who sell in the asset store should be encouraged to make their scripts available in multiple languages, otherwise I can see this causing problems.
Jul 15 '11 at 03:19 PM
Blankzz
(comments are locked)
|
