public Transform Target; public float CameraSpeed = 5; public float RX = 15; public float RY = 0; public float RZ = 0; // Update is called once per frame void UpdateRead More…
Talon New Test Post
Hello I am Talon and this is my first test post. With a picture.
Raw Gallery
Load Sources From Sources Folder
void Start () { GameObject instance = Instantiate(Resources.Load(“Cube1”, typeof(GameObject))) as GameObject; } Instantiate object from resources folder. Replace Cube1 for your object name.
Screen Click on object and get its Name and Coordinates.
RaycastHit hit; void Update () { if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1)) { Ray ray = GetComponent<Camera>().ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out hit)) { print(hit.transform.name); print(hit.point); //snap to grid once selected. hit.transform.position = new Vector3(Mathf.Round(hit.transform.position.x), Mathf.Round(hit.transform.position.y),Read More…
Unity3D
Testing
Camera Tracking
Track Movement By Camera public Transform target; // The distance in the x-z plane to the target public float distance = 15; // the height we want the camera to be aboveRead More…
Master Cube Collision
You gotta add your collision Cubes for this to work. See CubeRaider for more info. public GameObject CUBE; // Use this for initialization void Start () { } // Update is calledRead More…
Master Cube Movement
All the needed Code for Flip and Move. //Track Cube Movement And Location in map By X/Z Count Movement public float FromZFront = 0f; public float ToZFront= 0f; public float FromZBack =Read More…
Animation Based on KeyPress
public Animator Animation; public float AnimationLocation = 0f; void Start() { Animation = GetComponent<Animator>(); } void Update(){ if (Input.GetKeyDown(KeyCode.W)) { //Param: AnimationName, Layer, StartTime Animation.Play(“AnimationNameHere”, -1, AnimationLocation); } }