- Home /
Question by
unity_JaL6pRCgCNL_cQ · Dec 04, 2020 at 10:20 PM ·
erroreditorvisual studiohierarchy
I'm using Unity 5.4.When I run my Unity project, in the hierarchy window it shows as "filename(Not loaded)". _Also, the project freezes_
Hello, When I run a project, it shows "first(not loaded)". and the project freezes. Here is how it looks like - So what is this error?? And, I'm using "Visual Studio 2019" as the editor and I am using Unity version 5.4. Here is the source code of the file. This might help as there are chances there is an error in this source code of the sprite which is causing this "(not loaded)" error -
using UnityEngine;
using UnityEngine.SceneManagement;
public class Bird : MonoBehaviour
{
Vector3 _initialPosition;
[SerializeField] private float _launchPower = 500;
private void Awake()
{
_initialPosition = transform.position;
}
//the repeating
private void Update()
{
if (transform.position.y > 15)
{
string currentSceneName = SceneManager.GetActiveScene().name;
SceneManager.LoadScene(currentSceneName);
}
if (transform.position.x > 15)
{
string currentSceneName = SceneManager.GetActiveScene().name;
SceneManager.LoadScene(currentSceneName);
}
if (transform.position.x < -15)
{
string currentSceneName = SceneManager.GetActiveScene().name;
SceneManager.LoadScene(currentSceneName);
}
if (transform.position.y < -15)
{
string currentSceneName = SceneManager.GetActiveScene().name;
SceneManager.LoadScene(currentSceneName);
}
}
private void OnMouseDown()
{
{
GetComponent<SpriteRenderer>().color = Color.green;
}
}
private void OnMouseUp()
{
GetComponent<SpriteRenderer>().color = Color.white;
Vector2 directionToInitialPosition = _initialPosition - transform.position;
GetComponent<Rigidbody2D>().AddForce(directionToInitialPosition * _launchPower);
GetComponent<Rigidbody2D>().gravityScale = 1;
}
private void OnMouseDrag()
{
Vector3 newPosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
transform.position = new Vector3 (newPosition.x, newPosition.y);
}
}
file.png
(32.2 kB)
Comment
Your answer
Follow this Question
Related Questions
Double clicking scene asset opens the asset file in visual studio 5 Answers
Hierarchy not showing anything, getting KeyNotFoundException 1 Answer
Is there a way to stylize EditorGUI.ObjectField? 0 Answers
How can i make both two cameras to follow the player but only one with control on player ? 0 Answers