Since we are programming mainly with C# I had to convert some of the js character scripts shipped with Unity to C#. Before anybody else wastes his time for this here they are.
If you encounter any problems/inconsistency using these compared with the js version please let me know.
Honestly? I just commented out the line and carried on. Vector3.Project seems to have some problems on iOS and since my game didn’t use ‘TooSteep()’, I just took it out.
I spent about 2 hours converting the CharacterMotor only to have it not work as expected. Thank you. Now I don’t need to reinvent and find the structural problems with the wheel.
that happens every time I connect to my photon server with client and join a random team in result a player is spawned with this script…
anywho could help me?
This looks a bit odd. Did you debug the code at this line (before the exception is thrown). What part of the equation leads to the issue? It looks very much as if the controller is null…
Maybe the order of script initialization is a problem here.
defaq, I added debug.log and it says its null…now what
its paradox, I looked on player prefab both playing and in editor and both cases I saw the Character Controller,
yet the dumb script dosent see it >:( oh and about the script init…
script is lockated in “Assets/Scripts/”.
and also the Execution Order is default.
please guys help I am totaly lost
Did you check that the controller has been set before the call? Btw. I recommend to use Monodevelop debugging for easy stepping through the code here. log messages might be a bit limited here.
I see that the FixedUpdate() method leeds to the call of the method. At least at this point the Awake() and Start() methods should have been called…
well it does
controller = this.controller inside of awake function…
that is the only place where it is decleared…
maybe some other method is required? if so please do write down witch
I’m hoping that these will work without much modification but serious thanks for this! I was trying to do the same sort of conversion and i thought i’d search first. Glad I did!
Thanks !
EDIT:
Ok, This is great but when I try to add these scripts to my PlayerController I get and error saying “Can not add scrip. Script needs to finish compiling before adding it” or some such.