Search Unity

Game Freezing

Discussion in 'PSM' started by SoloWanderer, Feb 10, 2015.

  1. SoloWanderer

    SoloWanderer

    Joined:
    Jan 28, 2015
    Posts:
    20
    Is it normal for your game to freeze in the middle of game play? This happened trice so far. 2/2 tests. My Ps Vita becomes unresponsive and I have to hold the power button for a while to do anything. Then it puts me into Safe Mode. Is the large limitations on what PSM can handle? Does it freeze when to much stuff happens? Or is it an error in my programming?

    Also, this didn't start happening until I added rotation of my players arm and my title screen with 1 object with the script:


    using UnityEngine;
    using System.Collections;

    public class Title : MonoBehaviour {

    void Update () {

    if (Input.GetButton("PSVITASTART")) {
    Application.LoadLevel ("a");
    print ("Pressed STart");
    }



    if (Input.GetKeyDown(KeyCode.Space)){
    print ("Pressed Space");
    Application.LoadLevel ("a");

    }
    }
    }


    It just freezes at a random point, one time it took about 15 seconds, the next time it took about 30 seconds, then the 3rd time took a minute or two!

    Also I've only tried my game when it's still connected to my computer, if that matters at all.
     
    Last edited: Feb 10, 2015
  2. jxxxxst

    jxxxxst

    Joined:
    Nov 3, 2012
    Posts:
    50
    Code (CSharp):
    1. if (Input.GetButton("PSVITASTART")) {
    2. Application.LoadLevel ("a");
    3. print ("Pressed STart");
    4. }
    should be

    Code (CSharp):
    1. if (Input.GetButtonDown("PSVITASTART")) {
    2. Application.LoadLevel ("a");
    3. print ("Pressed STart");
    4. }
    With GetButton in the Update loop, you might make your game load a level multiple times.

    For random crashes during gameplay, you would need to post more code or try and nail it down to certain events, so one could help you : )
     
  3. SoloWanderer

    SoloWanderer

    Joined:
    Jan 28, 2015
    Posts:
    20
    This is so frustrating. When I want it to crash, it never does! I think I'll just ignore it until I can figure out what's causing it. The next time I post on this thread will probably be when I figure out what is causing it. :(