Sphere + rigidbody + character controller

PS: Im super noob, started yesterday ;(

I read so many things about it, and no one could help me.

Im trying to simple add gravity to an object, AND movement too. I can’t do it just adding rigidbody (because of gravity) and Character Controller (because of movement) i don’t know, this things just dont stack!

Anyone can help me? I really need to move an object WITH gravity acting on it.

The CharacterController is what you need. If you just want gravity, move it with SimpleMove(speed) - speed is the velocity vector that shows in which horizontal direction to move. speed.y is ignored: SimpleMove takes care of the gravity for you. This is great, but as a bad collateral effect you can’t add code to jump (vertical movements are totally under system control). The example script in SimpleMove is all you need to move your character in the old Doom style: AD rotates the character, and WS moves it forward/backward.

If you plan to control vertical movement - to add things like jumping or flying, for instance - use Move(offset) instead (offset is the absolute displacement that the character will move). It’s more complex, since you must provide the gravity code. The example in 2 provides gravity and jump code, and moves the character to left/rigth/forth/back with the keys ADWS.

These examples work fine (the FPS Tutorial player movement script is basically the Move example, and the enemies are moved with SimpleMove) and are a good starting point to add other features.

NOTE: The only unsolvable problem with the CharacterController is the vertical direction: it’s assumed to be the Y axis, and you can’t change this (to make the character walk on the walls, for instance).