fixxed the bug that doubels the movementspeed *// v2.3 - 19.Sep.2013
what u need to setup to get this running.
0. the Player/whatever u want to move needs a CharacterController (Unity->Component->Physics)
the Main Camera needs to be tagged as MainCamera
the Player/whatever u want to move needs to be tagged as Player
the player needs to be added to a seperate layer
on the attached CameraController script u need to deselect the Layer from 3. at “collisionLayers”
the CharacterController script needs to be attached at the Player/whatever u want to move
the CameraController script needs to be attached at the Main Camera
“fix” for the clipping problem with the MainCamera. :
go to MainCamera → Camera → Clipping Planes → Near and set it to 0.01
go to MainCamera → Camera → Field of View and set a value around 70(it looks good)- 12.Oct.2012
Example Project - 16.Oct 2012
!! have fun with it and thx to all the other ppl who are working on this scripts !!
and here is the code
I had some free time and wrote a small website for it there u will find Version 2.3 of the character controller,
screenshots how to use the scripts, a playable webbrowser demo and some more details
"Your code-fu is strong grasshopper. "
hehe i know… i will add a js and a cs version in the next days, clean the code and do some better comment (as far as my english allows that ^^)
I added the scripts in JS and CS with code and for download also i made a codecleanup and corrected some “misstakes” and added some new futures (movements for animation)
Hey, this script is nice. I wanted to show you a video of my results though. I love the acute control of the camera, very nice. But when I run up or down terrain, the camera snaps in and out. Check this video
So, to be clear. My player is tagged as Player and also on another layer of Player. The camera is attached to my MainCamera. But the target is actually a childed game object called CameraTarget. Its really right behind the player. I got the same results when making the target the Player as well. Thanks
I had that problem too, i solved it by adding the layer.
thats a problem that there is still a gameobject between u and the camera that is not in the layer player layer, maybe try to place the camera and the player in the hirachy root without beeing in other gameobjects
"My player is tagged as Player and also on another layer of Player. The camera is attached to my MainCamera. But the target is actually a childed game object called CameraTarget. Its really right behind the player. I got the same results when making the target the Player as well. Thanks "
i didn’t understand that fully… My player is tagged as Player and also on another layer of Player. So u mean the Player is on the Layer Player ? The camera is attached to my MainCamera Did u mean the camera script or that the camera is part of a gameobject that is tagged as maincamera?
i have a gameobject and in it the player mesh with all the animation stuff and subobjects
my camera is tagged as MainCamera and in the Hierarchy root without anything else
they must be a gameobject between the gameobject tagged “Player” and the MainCamera tagged “MainCamera” that is not added to the Layer “Player”
that is all what i can tell u so far
moving the camera into the root hierarchy seemed to do the trick. I had it as a child of the player and it was assuming the Player layer as well. THanks for the tips. And great work, This is a nice, easy to use AND understand camera. Love it
UnityException: Input Axis Toggle Move is not setup.
To change the input settings use: Edit → Project Settings → Input
CameraControllerjs.LateUpdate () (at Assets/WowoThree/CameraControllerjs.js:66)
UnityException: Input Axis Run is not setup.
To change the input settings use: Edit → Project Settings → Input
CharacterControllerjs.Update () (at Assets/WowoThree/CharacterControllerjs.js:32)
Under Axes u see the Line “Size” increase the value by 2
now on the bottom of the list u see the last Action 3 times, open the last one and name it “Toggle Move” and set the “Positive Button” to any key u want for it (“mouse 3” for me- sidebutton)
do the same with the other duplicated entry and name it “Axis Run” and set the “Positive Button” to any key u want for it (“left shift” for me)
Had a quick look at the example project and it looks great so far but I had to make one small change to the strafing code…
on line 67 of the V2.2 Character Controller the strafing negative key is “q” (in the example project) but the code was also subtracting creating a double negative and basically making the controller go right instead of left.
was this:
moveDirection.x -= Input.GetAxis("Strafing");
changed to this:
moveDirection.x += Input.GetAxis("Strafing");
Please correct me if I’m wrong as I’ve only been awake for 10 minutes
Hello - just wanted to pop in and say I am using the latest version of your java scripts and they are working great. Thank you very much for the hard work on this.
Thank you to all those who worked on this
I haven’t looked at the post in forever and happened to see it in the forums today
Very nice job
““Only problem I am having is that when I jump while moving the camera zooms all the way into the player and then jumps back out really fast
Not sure if that explains it well or not but it seems the camera shouldn’t zoom in out out at all while jumping””
Did I set something up wrong or what haha
EDIT: Jumping problem due to tagging issue with my stand in character
He is made in Maya out of a couple cubes and spheres and all of them weren’t tagged as Player
Just would like to say thank you again for sharing this publicly
EDIT:
Still wondering wth "4. on the attached CameraController script u need to deselect the Layer from 3. at “collisionLayers” is supposed to mean
chrisx84, could u give me more infos whats not working
Nubz,
3. the player needs to be added to a seperate layer
4. on the attached CameraController script u need to deselect the Layer from 3. at “collisionLayers”
that mean u have to add the player to a seperate layer and then deselect this layer in the CameraController script under the option “collisionLayers”