Hello,
I would like to know if there's a way to prevent using the OnDestroy function when you change a scene.
I have some GameObjects that instantiate a new object when destroyed, but when I stop simulation or change scene Unity destroy all existing GameObjects but since it create new ones, Unity send me an error telling me that some objects weren't cleaned up.
It doesn't seem to make any other errors so it's not really problematic but I prefer to have a clean code without error
Thank you in advance :)
↧
Cancel OnDestroy when changing scene
↧
I have complier errors in a new empty project
I've started a new project but this has come up - there is nothing in there but there are errors and there is no information as to what those errors are
Any suggestions?
![alt text][1]
[1]: /storage/temp/133750-screen.jpg
↧
↧
An error has come up on a empty new project file, how do i finx this?
I've started a new project but this has come up - there is nothing in there but there are errors and there is no information as to what those errors are
Any suggestions?
![alt text][1]
[1]: /storage/temp/133750-screen.jpg
↧
Execute editor window scripts when project errors are present
Hi!
I'm trying to publish another asset to the asset store, but this one integrates some third party libraries. I was told that I couldn't submit these libraries directly within my package (even with their licenses) so I wanted to allow the users to download the dependencies with just a click through an editor window.
But I found that when there are errors on the project the editor window scripts won't run, and of course, without these third-party dependencies the project has some errors upon being downloaded. I was told to just put a disclaimer on the page and on the README file, but I'd really like to make things easier for anyone downloading this asset.
Is there any way to force the execution of editor window scripts? Or is there any way to ignore the "missing assembly reference" errors?
↧
Error occurs when trying to override AndroidManifest file in unity?
So I Created A manifest file in Assets/Plugin/Android/. The File contains:
Error Occurs when building:
> NullReferenceException: Object> reference not set to an instance of an> object>> UnityEditor.AndroidManifest.SetApplicationFlag> (System.String name, Boolean value)>> UnityEditor.AndroidManifest.SetDebuggable> (Boolean debuggable)
I followed the docs from [here][1], about **Overriding the Android Manifest**.
The apk builds fine when the manifest is removed.
***Complete Error:*** *NullReferenceException: Object reference not set to an instance of an object UnityEditor.AndroidManifest.SetApplicationFlag (System.String name, Boolean value) UnityEditor.AndroidManifest.SetDebuggable (Boolean debuggable) UnityEditor.Android.PostProcessor.Tasks.GenerateManifest.PatchManifest (UnityEditor.Android.PostProcessor.PostProcessorContext context, System.String manifest) UnityEditor.Android.PostProcessor.Tasks.GenerateManifest.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTargetGroup targetGroup, BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:286) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)*
**UNITY 2018.3.4f1**
[1]: https://docs.unity3d.com/Manual/android-manifest.html
↧
↧
I haven't add any script but it shows,I haven't add any script
I haven't add any script but once I click play it shows all compiler errors have to be fixed before you can enter play mode. it doesn't shows any error . I don't know what is going wrong . thank you ,I haven't add any script but once I click play it shows
all compiler errors have to be fixed before you can enter play mode. and no error shows at all. I don't know where to fix it. can anyone help thankyou .
↧
haven't added any script but it shows all compiler error
HI I have a question .Can anyone help please .I have use a simple 2d ball and set it collision both ground and ball then I click play and it shows all compiler errors have to be fixed before you can enter play mode .I haven't added any script but it shows all compiler error. NO ERROR shows up so I don't know where to fix . can anyone help please . thank you
↧
Assembly with name 'Unity.TextMeshPro.Editor' already exists,Assembly with name 'UnityEditor.StandardEvents' already exists,
Assembly with name 'Unity.TextMeshPro.Editor' already exists
Assembly with name 'UnityEditor.StandardEvents' already exists
Assembly with name 'Unity.PackageManagerUI.EditorTests' already exists
Assembly with name 'Unity.TextMeshPro.Tests' already exists
Assembly with name 'Unity.PackageManagerUI.Editor' already exists
Assembly with name 'Unity.TextMeshPro.Editor.Tests' already exists
Assembly with name 'Unity.TextMeshPro' already exists,
↧
How do I turn of the error flag in the console at run time?,How do I turn off the consoles error flag for all scripts?
Hey guys and gals I was wondering if any one can tell me how to turn off the error flag in the console at run time? I know about pragma and try loops. I was more hoping for a something that could do it to all my errors at once for all scripts? Please and thank you ,Hey guys I need to turn off all of the red errors in the editor at run time. I know about Pragma and Try loops but I was hoping someone might know how to turn it off for a editor in general?
↧
↧
UnityWebRequest Unknown Error in Android9.0
After android updated 9.0 today, all requests related to UnityWebRequest returned unknown error(Post/Get/Download)
↧
How do I solve my Match 3 Game coding error?,
I am working on a Match 3 game by following a Unity tutorial step by step on this web page: (https://www.raywenderlich.com/673-how-to-make-a-match-3-game-in-unity)
I am currently at the step where I put in lines of code that make it so that the sprites don't spawn in groups of 3 or more when the game starts. Here's what I have so far:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class BoardManager : MonoBehaviour {
public static BoardManager instance;
public List characters = new List();
public GameObject tile;
public int xSize, ySize;
private GameObject[,] tiles;
public bool IsShifting { get; set; }
void Start () {
instance = GetComponent();
Vector2 offset = tile.GetComponent().bounds.size;
CreateBoard(offset.x, offset.y);
Sprite[] previousLeft = new Sprite[ySize];
Sprite previousBelow = null;
}
private void CreateBoard (float xOffset, float yOffset) {
tiles = new GameObject[xSize, ySize];
float startX = transform.position.x;
float startY = transform.position.y;
for (int x = 0; x < xSize; x++) {
for (int y = 0; y < ySize; y++) {
GameObject newTile = Instantiate(tile, new Vector3(startX + (xOffset * x), startY + (yOffset * y), 0), tile.transform.rotation);
tiles[x, y] = newTile;
**newTile.transform.parent = transform; // 1
List possibleCharacters = new List(); // 1
possibleCharacters.AddRange(characters); // 2
possibleCharacters.Remove(previousLeft[y]); // 3
Sprite previousBelow = null;
possibleCharacters.Remove(previousBelow);
Sprite newSprite = possibleCharacters[Random.Range(0, possibleCharacters.Count)];
newTile.GetComponent().sprite = newSprite; // 3
previousLeft[y] = newSprite;
previousBelow = newSprite;**
}
}
}
}
I don't understand these steps:
1. Create a list of possible characters
for this sprite.
2. Add all characters to the list.
3. Remove the characters that are on
the left and below the current
sprite from the list of possible
characters.
I don't use C# often, so I'm not that familiar with it. I would really appreciate it if someone were to help me.
↧
Is it possible to use scripts without MonoBehaviour on GameObjects?
I'm researching random level generation in Unity for a school project and I decided to use a tutorial from a youtuber named Six Dot Studios. In the [video](https://www.youtube.com/watch?v=nADIYwgKHv4) description he linked his project, and I decided to check it out, but it doesn't work.
His "Room" script doesn't derive from MonoBehaviour and adding MonoBehaviour doesn't seem to make it work either, returning this error:
"You are trying to create a MonoBehaviour using the 'new' keyword. This is not allowed. MonoBehaviours can only be added using AddComponent(). Alternatively, your script can inherit from ScriptableObject or no base class at all UnityEngine.MonoBehaviour:.ctor() Room:.ctor(Vector2, Int32) (at Assets/Generation scripts/Room.cs:10) LevelGeneration:CreateRooms() (at Assets/Generation scripts/LevelGeneration.cs:56) LevelGeneration:Start() (at Assets/Generation scripts/LevelGeneration.cs:23)"
I can add more info if needed and the scripts can all be downloaded in the video desc, but my question is as follows
**TL;DR: Is it possible to create a secondary, non-MonoBehaviour C# script and then add it to a GameObject through a Primay C# one?**
His "Room" script doesn't derive from MonoBehaviour and adding MonoBehaviour doesn't seem to make it work either, returning this error:
"You are trying to create a MonoBehaviour using the 'new' keyword. This is not allowed. MonoBehaviours can only be added using AddComponent(). Alternatively, your script can inherit from ScriptableObject or no base class at all UnityEngine.MonoBehaviour:.ctor() Room:.ctor(Vector2, Int32) (at Assets/Generation scripts/Room.cs:10) LevelGeneration:CreateRooms() (at Assets/Generation scripts/LevelGeneration.cs:56) LevelGeneration:Start() (at Assets/Generation scripts/LevelGeneration.cs:23)"
I can add more info if needed and the scripts can all be downloaded in the video desc, but my question is as follows
**TL;DR: Is it possible to create a secondary, non-MonoBehaviour C# script and then add it to a GameObject through a Primay C# one?**
↧
Source code
Hi! Please tell me, I bought the source of the game "Shoot'em up 2D Starter Kit" for$20. At first I looked at all the screenshots games, video games, like everything was fine. Paid and decided to run in unity. When I started the game the character began to disappear under the textures and in principle the game is not playable. What to do in such cases? Can I get my money back, or fix a mistake?
↧
↧
There‘s an error occured when I installed the newest Unity personal.,there's error ocurse when I installed the newest Unity personal.And I don't know how to deal it.Any big bro can help me
lni file doesn't contain cmd for component Windows-IL2CPP. Don't know how to install this![alt text][1]
[1]: /storage/temp/134213-unityerror.png
,![alt text][1]
[1]: /storage/temp/134212-unityerror.png
↧
Update Unity FFMpeg in iOS
Hi everyone,
I have a problem trying to create a video editor. I am using the FFMpeg library from this plugin https://assetstore.unity.com/packages/tools/video/ffmpeg-unity-bind-93622 Everything works ok in Android and PC but when I compile a version for iOS the video can't be created.
The video I am trying to create is using the Drawtext filter but in iOS doesn't work. I am thinking is because I need the freetype library configurated in the FFMpeg library. So, I am trying to update the FFMpeg library from here: https://github.com/tanersener/mobile-ffmpeg. I Just copy the static files from the new library and put it in the same folder from the FFMpeg plugin. But I get some errors.
Anyone knows how to update that plugin? Or how can I do a workaround to get the Drawtext filter working in iOS?
Thanks in advance!
↧
No errors, but they don't apply to the game.
for (int i = 0; i < gameData.answers.Length; i++)
{
gameIndex = Random.Range(0, gameData.answers.Length );
}
↧
Getting a black screen within Build completed with 'Succeeded'
Hi there,
I have a problem with my Unity Project. If I build my project on Windows (via .exe), it will work perfectly. But if I build my project on Android, the console gives two errors:
1. Build completed with a result of 'Failed' UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
2. UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x00234] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:190 at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:96 UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
But the console gives also:
Build completed with a result of 'Succeeded' UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) So I start my APK, and the unity logo appears. Later there is a black screen and I can't act with the app in any way. But why?
I have a problem with my Unity Project. If I build my project on Windows (via .exe), it will work perfectly. But if I build my project on Android, the console gives two errors:
1. Build completed with a result of 'Failed' UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
2. UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x00234] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:190 at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:96 UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
But the console gives also:
Build completed with a result of 'Succeeded' UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) So I start my APK, and the unity logo appears. Later there is a black screen and I can't act with the app in any way. But why?
↧
↧
ERROR, please help !! "ReleaseForRunning"
Hey, I've been stuck for weeks with an error that I get when I try to run my app with xcode.
**Error: "Unity-iPhone" requires a provisioning profile with the Game Center feature. Select a provisioning profile for the "ReleaseForRunning" build configuration in the project editor. (in target 'Unity-iPhone')**
someone has already had this problem ? I did not find anything on forums. ![alt text][1]
[1]: /storage/temp/134288-screenshot-2019-03-06-at-165103.png
↧
AGAIN ERROR, help ReleaseForRunning
Hey, I've been stuck for weeks with an error that I get when I try to run my app with xcode.
**Error: "Unity-iPhone" requires a provisioning profile with the Game Center feature. Select a provisioning profile for the "ReleaseForRunning" build configuration in the project editor. (in target 'Unity-iPhone')**
someone has already had this problem ? I did not find anything on forums.
![alt text][1]
[1]: /storage/temp/134289-screenshot-2019-03-06-at-165103.png
↧
Unity can't use the script.
![alt text][1]
[1]: /storage/temp/132917-unitybug1.png
My C# script's name is same, and not include invalid text, but why Unity says me 'No MonoBehaviour scripts in the file, or their names do not match the file name'?
↧