Unity different physics behaviour in different screen sizesCharacter Movement with equal maximum speeds in all directions using analog gamepad controlsunity 4.6 slider player movementUnity android weird build behaviourMoving objectes on the screen have bluraddforce in unity androidTwitching objects in Unity during camera movement in 2Dunity 5 character jumpingUnity - Stay Within Screen BoundsMoving a sprite using math in UnityHitting a character physics?

Why force the nose of 737 Max down in the first place?

Should I accept an invitation to give a talk from someone who might review my proposal?

How can chaotic entities be prevented from spreading beyond their domain?

How did the Axis intend to hold the Caucasus?

Do 3/8 (37.5%) of Quadratics Have No x-Intercepts?

Blank spaces in a font

Why are we moving in circles with a tandem kayak?

How was text handled on the Amstrad CPC 464?

GNU sort stable sort when sort does not know sort order

Why does aggregate initialization not work anymore since C++20 if a constructor is explicitly defaulted or deleted?

Can a US President, after impeachment and removal, be re-elected or re-appointed?

Should I let a company know I've reverse engineered and rebuilt their app?

Struggling with cyclical dependencies in unit tests

Did Vladimir Lenin have a cat?

Assuring luggage isn't lost with short layover

Get string from array or set default value in a one liner

Composing fill in the blanks

Can Papyrus be folded?

Desktop app status bar: Notification vs error message

Why is it considered acid rain with pH <5.6?

Nuclear breeder/reactor plant controlled by two A.I. makes too much power

Why does the Eurostar not show youth pricing?

Why were contact sensors put on three of the Lunar Module's four legs? Did they ever bend and stick out sideways?

What are the closest international airports in different countries?



Unity different physics behaviour in different screen sizes


Character Movement with equal maximum speeds in all directions using analog gamepad controlsunity 4.6 slider player movementUnity android weird build behaviourMoving objectes on the screen have bluraddforce in unity androidTwitching objects in Unity during camera movement in 2Dunity 5 character jumpingUnity - Stay Within Screen BoundsMoving a sprite using math in UnityHitting a character physics?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















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, the character moves obviously 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 timing and the timing depends on speed.










share|improve this question
























  • It is very curious, as there should be nothing like that in Unity. Screen size and physics are unrelated. I suggest you do like that: print the actual value of rigidbody velocity and maybe forces in real time and see whats actually going on. Quickest way to do it is probably using legacy GUI: void OnGUI() GUI.Label(new Rect(10, 10, 100, 20), rigidbody.velocity.ToString());

    – Yuri Nudelman
    Apr 4 at 17:53


















2















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, the character moves obviously 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 timing and the timing depends on speed.










share|improve this question
























  • It is very curious, as there should be nothing like that in Unity. Screen size and physics are unrelated. I suggest you do like that: print the actual value of rigidbody velocity and maybe forces in real time and see whats actually going on. Quickest way to do it is probably using legacy GUI: void OnGUI() GUI.Label(new Rect(10, 10, 100, 20), rigidbody.velocity.ToString());

    – Yuri Nudelman
    Apr 4 at 17:53














2












2








2








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, the character moves obviously 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 timing and the timing depends on speed.










share|improve this question














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, the character moves obviously 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 timing and the timing depends on speed.







unity3d game-physics physx






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 26 at 20:23









BamdadBamdad

491 silver badge10 bronze badges




491 silver badge10 bronze badges















  • It is very curious, as there should be nothing like that in Unity. Screen size and physics are unrelated. I suggest you do like that: print the actual value of rigidbody velocity and maybe forces in real time and see whats actually going on. Quickest way to do it is probably using legacy GUI: void OnGUI() GUI.Label(new Rect(10, 10, 100, 20), rigidbody.velocity.ToString());

    – Yuri Nudelman
    Apr 4 at 17:53


















  • It is very curious, as there should be nothing like that in Unity. Screen size and physics are unrelated. I suggest you do like that: print the actual value of rigidbody velocity and maybe forces in real time and see whats actually going on. Quickest way to do it is probably using legacy GUI: void OnGUI() GUI.Label(new Rect(10, 10, 100, 20), rigidbody.velocity.ToString());

    – Yuri Nudelman
    Apr 4 at 17:53

















It is very curious, as there should be nothing like that in Unity. Screen size and physics are unrelated. I suggest you do like that: print the actual value of rigidbody velocity and maybe forces in real time and see whats actually going on. Quickest way to do it is probably using legacy GUI: void OnGUI() GUI.Label(new Rect(10, 10, 100, 20), rigidbody.velocity.ToString());

– Yuri Nudelman
Apr 4 at 17:53






It is very curious, as there should be nothing like that in Unity. Screen size and physics are unrelated. I suggest you do like that: print the actual value of rigidbody velocity and maybe forces in real time and see whats actually going on. Quickest way to do it is probably using legacy GUI: void OnGUI() GUI.Label(new Rect(10, 10, 100, 20), rigidbody.velocity.ToString());

– Yuri Nudelman
Apr 4 at 17:53













2 Answers
2






active

oldest

votes


















2














Physics works in WorldSpace and has nothing to do with ScreenSpace, so your problem is beyond what it seems to be. The performance drop on android is expected, but in standalone, make sure you use FixedUpdate for physics operations (which you do here) and make sure nothing is causing FixedTimeStep to change during the game by any chance.






share|improve this answer




















  • 1





    Yea, thanks for the answer, I found out that there was a Update method in a driven class which was effecting on the rigidbody. Thanks for reminding me of FixedUpdate.

    – Bamdad
    Apr 4 at 17:54


















3














did you try to multiply your speed with Time.fixedDeltaTime ?
If it didn't work, try platform dependent compilation:



 #if UNITY_STANDALONE_WIN
//do something
#elif UNITY_ANDROID
// do something
#endif





share|improve this answer



























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55365647%2funity-different-physics-behaviour-in-different-screen-sizes%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    Physics works in WorldSpace and has nothing to do with ScreenSpace, so your problem is beyond what it seems to be. The performance drop on android is expected, but in standalone, make sure you use FixedUpdate for physics operations (which you do here) and make sure nothing is causing FixedTimeStep to change during the game by any chance.






    share|improve this answer




















    • 1





      Yea, thanks for the answer, I found out that there was a Update method in a driven class which was effecting on the rigidbody. Thanks for reminding me of FixedUpdate.

      – Bamdad
      Apr 4 at 17:54















    2














    Physics works in WorldSpace and has nothing to do with ScreenSpace, so your problem is beyond what it seems to be. The performance drop on android is expected, but in standalone, make sure you use FixedUpdate for physics operations (which you do here) and make sure nothing is causing FixedTimeStep to change during the game by any chance.






    share|improve this answer




















    • 1





      Yea, thanks for the answer, I found out that there was a Update method in a driven class which was effecting on the rigidbody. Thanks for reminding me of FixedUpdate.

      – Bamdad
      Apr 4 at 17:54













    2












    2








    2







    Physics works in WorldSpace and has nothing to do with ScreenSpace, so your problem is beyond what it seems to be. The performance drop on android is expected, but in standalone, make sure you use FixedUpdate for physics operations (which you do here) and make sure nothing is causing FixedTimeStep to change during the game by any chance.






    share|improve this answer













    Physics works in WorldSpace and has nothing to do with ScreenSpace, so your problem is beyond what it seems to be. The performance drop on android is expected, but in standalone, make sure you use FixedUpdate for physics operations (which you do here) and make sure nothing is causing FixedTimeStep to change during the game by any chance.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Apr 4 at 17:34









    soheilghsoheilgh

    362 bronze badges




    362 bronze badges










    • 1





      Yea, thanks for the answer, I found out that there was a Update method in a driven class which was effecting on the rigidbody. Thanks for reminding me of FixedUpdate.

      – Bamdad
      Apr 4 at 17:54












    • 1





      Yea, thanks for the answer, I found out that there was a Update method in a driven class which was effecting on the rigidbody. Thanks for reminding me of FixedUpdate.

      – Bamdad
      Apr 4 at 17:54







    1




    1





    Yea, thanks for the answer, I found out that there was a Update method in a driven class which was effecting on the rigidbody. Thanks for reminding me of FixedUpdate.

    – Bamdad
    Apr 4 at 17:54





    Yea, thanks for the answer, I found out that there was a Update method in a driven class which was effecting on the rigidbody. Thanks for reminding me of FixedUpdate.

    – Bamdad
    Apr 4 at 17:54













    3














    did you try to multiply your speed with Time.fixedDeltaTime ?
    If it didn't work, try platform dependent compilation:



     #if UNITY_STANDALONE_WIN
    //do something
    #elif UNITY_ANDROID
    // do something
    #endif





    share|improve this answer





























      3














      did you try to multiply your speed with Time.fixedDeltaTime ?
      If it didn't work, try platform dependent compilation:



       #if UNITY_STANDALONE_WIN
      //do something
      #elif UNITY_ANDROID
      // do something
      #endif





      share|improve this answer



























        3












        3








        3







        did you try to multiply your speed with Time.fixedDeltaTime ?
        If it didn't work, try platform dependent compilation:



         #if UNITY_STANDALONE_WIN
        //do something
        #elif UNITY_ANDROID
        // do something
        #endif





        share|improve this answer













        did you try to multiply your speed with Time.fixedDeltaTime ?
        If it didn't work, try platform dependent compilation:



         #if UNITY_STANDALONE_WIN
        //do something
        #elif UNITY_ANDROID
        // do something
        #endif






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 27 at 1:28









        SpounkaSpounka

        935 bronze badges




        935 bronze badges






























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55365647%2funity-different-physics-behaviour-in-different-screen-sizes%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

            155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해