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;
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
add a comment |
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
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
add a comment |
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
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
unity3d game-physics physx
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
add a comment |
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
add a comment |
2 Answers
2
active
oldest
votes
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.
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
add a comment |
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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
add a comment |
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
add a comment |
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
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
answered Mar 27 at 1:28
SpounkaSpounka
935 bronze badges
935 bronze badges
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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