What do you want to save?
Add Code snippet
New code examples
-
C# 2022-03-27 19:15:02
top down shooting in unity 2D
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Shooting : MonoBehaviour { public Transform firePoint; public GameObject bulletPrefab; public float bulletForce = 20f; // Update is called once... Add solution -
C# 2022-02-28 14:55:08
unity object with gameobject
//define "myObject" //(asign in in inspector) public GameObject myObject; //runs when you hit the play button void Start() { //change the name to "myObjectsNewName" myObject.name = "myObjectsNewName"; } //Note for Unity a... Add solution -
C# 2022-02-26 02:15:07
unity adding component to another gameobject
//referencing a gameobject public GameObject exampleObject; //===============================================================> private Rigidbody rb; //example of a component public void Awake() { // adding a Rigidbody component to exampleObject rb =... Add solution -
-
-
Other 2022-01-30 11:55:32
unity random array element
using UnityEngine; using System.Collections; public class GameController : MonoBehaviour { public GameObject Enemy; public GameObject Player; public float sd = 5f; public float dia = 0.005f; public float[] yValues = new float[] {-3.5... Add solution