I'm working on a 2D top-down open-world game in which there is a character who can be moved by keyboard functions. The movement is caused by Rigidbody.AddForce().
The problem is that the moving speed is not the same in different screen sizes.
Here's the simple code:
void FixedUpdate()
{
if (Input.GetButton("Move"))
rigidbody.AddForce(transform.forward * speed);
}
The character's mass is the same, the float speed is the same but yet, after I switch the game view to full screen, obviously the character moves faster. (Which is odd, and shows that it's not a performance problem.)
I've tried to test the standalone build, everything's fine there (however it seems a bit slower in android build.) but I need to have a common speed in the editor because I have to design levels that depend on the timing and the timing depends on the speed.
void OnGUI(){ GUI.Label(new Rect(10, 10, 100, 20), rigidbody.velocity.ToString()); }
– Worsham