Blazer Geschrieben 5. Juni 2021 Melden Share Geschrieben 5. Juni 2021 I have bound a script to an object and now I want to execute the script by clicking on the start icon but then Unity hangs completely. There is no error message and I can't close it anymore. C# is open only as info Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Sascha Geschrieben 5. Juni 2021 Melden Share Geschrieben 5. Juni 2021 Might be a reasonable idea to attach the code you're talking about. Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Blazer Geschrieben 6. Juni 2021 Autor Melden Share Geschrieben 6. Juni 2021 with any code this happens Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Sascha Geschrieben 6. Juni 2021 Melden Share Geschrieben 6. Juni 2021 I highly doubt that. The behavior you described is caused by an endless loop, which has to be coded somewhere. And it'as rather unlikely that it's a Unity issue that noone else has discovered. So if it's not your custom code, then there's some Plugin involved that you added to the project. Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Blazer Geschrieben 6. Juni 2021 Autor Melden Share Geschrieben 6. Juni 2021 If i delete Unity and reinstall it. Then it might help, I don`t have any plugins and the code are simple arrays or methods. The code always just has on of it at a time since I try to learn coding but it doesn`t matter if I replace the code with sth. else. But it`s always simple. If I knew where the Project would be safed, it would be maybe helful to reinstall unity Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Sascha Geschrieben 6. Juni 2021 Melden Share Geschrieben 6. Juni 2021 Reinstalling Unity won't change anything. The issue is somewhere in your project. Can you create a new scene, a GameObject in it, then drop a script on it and have it freeze? Then post that script here so we can have a look at it? Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Blazer Geschrieben 6. Juni 2021 Autor Melden Share Geschrieben 6. Juni 2021 using System.Collections; using System.Collections.Generic; using UnityEngine; public class DummyScript : MonoBehaviour { private Rigidbody rigidbody; void Start() { rigidbody = GetComponent<Rigidbody>(); } private void OnMouseEnter() { rigidbody.AddForce(new Vector3(0, 10, 0), ForceMode.Impulse); } void Update() { } } Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Blazer Geschrieben 6. Juni 2021 Autor Melden Share Geschrieben 6. Juni 2021 I made a new objeckt and made a new c# script but this time it says: The script don`t inherit a native class that can manage a script. What problem do I have there Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Sascha Geschrieben 7. Juni 2021 Melden Share Geschrieben 7. Juni 2021 The script you posted looks okay. Does this happen even in an otherwise empty, new project? Do you have a screenshot of the error popup? Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Blazer Geschrieben 7. Juni 2021 Autor Melden Share Geschrieben 7. Juni 2021 There is no error message. It just freezes and nothing happens. I can only shut down the pc to close unity. I try now to make a new one Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Blazer Geschrieben 7. Juni 2021 Autor Melden Share Geschrieben 7. Juni 2021 A new preject works! The old one isn`t important since there was just some test code on it. But it could be that I once removed a component of the cube that I had in the Scene. But I don`t know if I deleted a wrong on. But I don`t think this would lead to this freezing problem Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Recommended Posts
Archiviert
Dieses Thema ist jetzt archiviert und für weitere Antworten gesperrt.