timer = new GameObject(“moveTimer”);
timer.AddComponent(MovementTimer);
Hi, I’m using the code above to add a script to a new GameObject. but the “addcomponent” line seems to make Unity freeze during runtime. I really don’t have a clue what could be causing this as there is no error message. Has this ever happened to anyone before?
I didn’t mean to mark my answer as the correct one, if that’s what you mean. I merely mean to mark this question as answered overall.
I (and probably others), browse in here a few times and in a very limited time a day. I try to help with whatever I can, the same way others have (and do) help me constantly.
When I come here, I filter by unanswered questions and I’ve been finding a lot of questions already answered that are not marked as answered, and it’s a waste of valuable time that could get someone unstuck with a problem.
I could care less about having answered questions or badges or any other stuff. I do this to give back to a community that has constantly helped me selflessly.