Screen resolution and velocity
Hello all!
I'm new at Unity (only 4 month) and have one problem. I've add UI in my game and set "Canvas Scaler" => "UI Scale mode" to "Scale With Screen Size". I typed this for better vision. Maybe, that will help.
Here is the problem:
My objects (enemies for player) have "Rigidbody2d" component and I'm setting fixed velocity for them. When I change resolution in Unity Editor or in my Game Build, the speed of objects become faster with small resolution and slower with bigger resolution.
How can I fix this problem simply?
Cuz, I've already typed this script:
In the beginning of the game I take value of scale from object with Canvas Scaler. Then, I'm multiplying it on objects speed. But, I don't know, is this the best choice?
Answer by majc · Apr 13, 2016 at 07:30 PM
I have the same problem!! If i find the answer I'll post it here.
Answer by Highwalker · Apr 13, 2016 at 07:38 PM
I think what might be happening is that your framerate is changing too much between resolutions. To fix that, simply multiply your speed variable by Time.deltaTime
$$anonymous$$aybe, it's a solution. I'll test it as soon as possible. Thanks for your reply!
Your answer
![](https://koobas.hobune.stream/wayback/20220612053808im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
reset velocity 1 Answer
Rigidbody - Why does my issue get fixed by doing THIS? 0 Answers
Unity Wheelcollider stops working after reaching 0 velocity 0 Answers
Jumping with rigidbody is random 1 Answer
Error CS1612 1 Answer