Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolution Problem

Discussion in 'Scripting' started by JohnDmu, Apr 21, 2015.

  1. JohnDmu

    JohnDmu

    Joined:
    Apr 8, 2015
    Posts:
    33
    Hello i created i game..Its working fine one my HTC M8.
    But i tested it in a lg l65 (480x320)
    and its unplayable! Although when i select 480x800 in unity its working fine!!???
    PLEASE HELP
     
  2. jtsmith1287

    jtsmith1287

    Joined:
    Aug 3, 2014
    Posts:
    787
    Well 480x320 is crazy different from 480x800. So unless you have implemented good UI scaling you're going to see some nasty stuff. If you're using the OnGui call I have no idea how to help you. If you're using the new UI then make sure your elements are all anchored correctly and the canvases scale correctly.
     
  3. JohnDmu

    JohnDmu

    Joined:
    Apr 8, 2015
    Posts:
    33
    i mean 480 x 800 my false!!
    no problem with ongui ..i have a problem with my obstacles they behave mad
     
  4. WheresMommy

    WheresMommy

    Joined:
    Oct 4, 2012
    Posts:
    890
    Some screenshots would be great to see, what your problem is exactly.
     
  5. JohnDmu

    JohnDmu

    Joined:
    Apr 8, 2015
    Posts:
    33
    i have a script for my obstacles
    that calculate the distance of my player IF THE DISTANCE IS smaller than a value they start moving..
    i have one obstacle in the right and one in the left part of my screen

    thats the script for the right obstacle for example!!

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class movewhenminus : MonoBehaviour {
    5.     public float distance;
    6.     public float distancer;
    7.     public float speed2;
    8.     public Transform target;
    9.     public float obstaspeed;
    10.     public float value;
    11.  
    12.  
    13.  
    14.     // Use this for initialization
    15.     void Start () {
    16.      
    17.     }
    18.  
    19.     // Update is called once per frame
    20.     void Update () {
    21.      
    22.         distance =Vector3.Distance(transform.position,target.position);
    23.         if ( distance < 27f) {
    24.          
    25.             float value = GameManager.Instance.moveFactor;
    26.             distancer = 100 - value;          
    27.             transform.position += new Vector3 (distancer * Time.deltaTime/15 * -obstaspeed  , 0.0f , 0.0f);
    28.         }
    29.      
    30.      
    31.      
    32.     }
    33. }

    MAYBE THE DISTANCE IS DIFFERENT IN DIFFERENT RESOLUTIONS??
    BECAUSE THE OBSTACLES ARE CLOSING TOO FAST AND MY PLAYER CANT PASS THROUGH THEM!

    ALTHOUGH IN MY HTC ONE M8 AND ON MY TABLET ITS WORKING JUST FINE
     
  6. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    If you're using UGUI, simply set the Canvas Scaler to "Scale With Screen Size" then set the reference resolution to "480x320". It will look the same across all resolutions.

    Edit : Just realized that UI wasn't your problem.
     
  7. JohnDmu

    JohnDmu

    Joined:
    Apr 8, 2015
    Posts:
    33
    thanks to all of you ..
    It seems that i found what the problem was!

    im using a random number generator that my obstacles get the instance number from
    and they cover a distance!
    i had the random range to 0,100 and my obstacles speed low..
    i tried changing the radnom range to 0,20 and making my obstacles move faster so im done now!!
    thank you very much everyone have a nice day