N_K wrote:
1, Do you know a sollution to this gravity-related problem?
I suppose that even though you set the velocity to 0, for one tick gravity can affect it, increasing the speed slightly, making it move down a little.
To make gravity work normally you could set the velocity to (0, oldYVelocity, 0) instead of (0, 0, 0), keeping the vertical velocity.
N_K wrote:
2, Does it worth to keep on playing around with this controller, or is it fundamentally broken, and I'd better to forget about it?
It's not fundamentally broken, but the question of dynamic (i.e. constrained rigid body) vs. kinematic controller (i.e. self-written physics) remains.
The problem is that characters are not rigid bodies, and as such approximating them as one is hard. For example, you don't want a character to be able to fall over. You don't want him to slide down slopes. (And I suppose as with the gravity this still happens in your case, if only slightly.) You want to be able to ascend stairs. A Rigid Body doesn't work like that, usually, so you have to constrain it a lot.
If you write the physics yourself, you have greater control at the cost of more work, since you have to code all interactions, like gravity, not moving through walls, pushing dynamic objects etc. yourself.
Maybe a dynamic controller is fine for you, maybe it's not - I guess it depends on what you need and how much work you're willing to do. As for me, I'm going to write a kinematic character controller, but it's pretty complex and I haven't really started yet.
I'm sure you can find out more about dynamic vs. kinematic character controllers by searching the internet, for example [ulr=http://www.digitalrune.com/Support/Blog/tabid/719/EntryId/40/Kinematic-vs-Dynamic-Character-Controllers.aspx]this[/url].