About 156,000 results
Open links in new tab
  1. How to create animation clip via script in Unity? - Stack Overflow

    May 5, 2022 · I want to create an AnimationClip in script against a GameObject in Unity. However, I do not know how to do it. I have attached the following code to a GameObject in …

  2. Create material from code and assign it to an object

    Oct 8, 2016 · The example below will create a Material, assign standard shader to it then change the texture to the texture from the myTexture variable before applying it to a GameObject.

  3. c# - How Do I Create A List In Unity? - Stack Overflow

    Aug 12, 2020 · 0 When I create a list, I get this error: using the generic type system.collections.generic.list' requires 1' type argument (s) Here is my code:

  4. How to make the script wait/sleep in a simple way in unity

    There are many ways to wait in Unity. They are really simple but I think it's worth covering most ways to do it: 1.With a coroutine and WaitForSeconds. This is by far the simplest way. Put all …

  5. how to change sprite ( Source sprite ) into UI Image using a script

    May 17, 2024 · public Image uiImage; You can drag and drop your Image into the script component from your Unity editor or you can use the GameObject.GetComponent<> () …

  6. c# - Simple event system in Unity - Stack Overflow

    Mar 27, 2016 · I see; I did implement my system using regular C# code with Events and Delegates, but this is much easier, and comform to the ECS model, like everything else in Unity.

  7. Creating a Scriptable Object in the Unity Editor - Stack Overflow

    May 28, 2018 · How do you create a scriptable object in the editor? I have the project open, it looks like this: Click the Create button as if you wanted to create a folder or C# script or …

  8. c# - Unity camera follows player script - Stack Overflow

    Jan 20, 2021 · I'm pretty new to Unity. I tried to create a script that the camera would follow the actor (with a little difference). Is there a way to improve the code? It works just fine. But I …

  9. How to create a mesh dynamically In unity - Stack Overflow

    Mar 8, 2019 · This code will draw a square at the position of the prefab, if you keep adding vertices you can generate a more complex mesh. The source of information is a tutorial to …

  10. c# - Unity Create UI control from script - Stack Overflow

    Dec 17, 2016 · You are supposed to make the Toggle the child of the Canvas. You didn't do that in your code. Also, you move a UI component and GameObject with …