# Movement FPS Independent, how to?

Hello people, I’ve already asked this here a few times, but no one awsered, so let’s try again.
I’ve made a Character controller myself, and I tought i did things right when it comes to FPS independency, but when I tessted in other machines, it does’nt seem so.

My code is pretty big. but the main lines are these:

``````if(grounded == false) //Gravity for falling
{finalmovement.y -= gravity * Time.deltaTime;}
if(Input.GetButtonDown("Jump")) //Jumping
{finalmovement.y = 7;}

myTransform.position += (myTransform.rotation * finalmovement)*Time.deltaTime; //Overall movement
``````

I tought it is ok, if my character is not on the ground, the gravity is applied with Time.deltaTime, and if I jump, the Y of finalmovement goes to 7 and then starts to go down with the gravity to make my character move downward.

But the problem is, when i have low fps, my character doesn’t jump as high. why?
It seems that the gravity is being applied more strongly ( I guess its because the Time between frames is bigger ), in other words, my movement is not FPS independent, even if I use Time.deltaTime. How can I solve this? Is my guess about the problem right?

myTransform.position += (myTransform.rotation * finalmovement)

ok well this line above, i can’t believe the compiler is even allowing such a thing

you have

vector3 += quanternion * vector3 * float

now vectors can be rationally multipled against floats (and probably quans too)
but multiplying a vector3 against a quan is just wierd. a quan is 4 values a vector is 3 i’ve no idea how you logically compute that.

Irregardless remove the mytransform.rotation. There is no reason it should ever be in there that is causing wierd bugs and is probably your problem.

Also you probably should use fixed update for charactermovement not update. The thing is fixedupdate is where physics occurs, if you want to use colliders and things you want to use fixedupdate. That’s just a suggestion though, my guess is removing the rotation will fix it.