Oculus Quest 3 available pre-orders
The Meta Quest 3 has been officially launched and is now available for pre-order, with shipments scheduled to begin on October 10th. For those interested in getting their hands on…
The Meta Quest 3 has been officially launched and is now available for pre-order, with shipments scheduled to begin on October 10th. For those interested in getting their hands on…
using UnityEngine; public class Mover : MonoBehaviour { public float speed = 5f; private void Update() { transform.position += transform.forward * speed * Time.deltaTime; } }
using UnityEngine; public class Rotator : MonoBehaviour { public Vector3 axis = Vector3.up; public float rotationSpeed = 30f; private void Update() { transform.Rotate(axis, rotationSpeed * Time.deltaTime); } }
using UnityEngine; public class CollisionDetector : MonoBehaviour { private void OnCollisionEnter(Collision collision) { Debug.Log("Collision detected between " + gameObject.name + " and " + collision.gameObject.name); } }
int SumEvenNumbers(int arr) { int sum = 0; foreach (int i in arr) { if (i % 2 == 0) { sum += i; } } return sum; }
using UnityEngine; public class ObjectMoveAlongPath : MonoBehaviour { public Transform path; public float speed = 2f; private int currentPathIndex = 0; private Vector3 currentTarget; private void Start() { currentTarget =…
using UnityEngine; public class ObjectRotate : MonoBehaviour { public float rotationSpeed = 90f; private void Update() { if (Input.GetKey(KeyCode.LeftArrow)) { transform.Rotate(Vector3.up, -rotationSpeed * Time.deltaTime); } if (Input.GetKey(KeyCode.RightArrow)) { transform.Rotate(Vector3.up, rotationSpeed…
using UnityEngine; public class ObjectResize : MonoBehaviour { public float resizeSpeed = 0.1f; private void Update() { if (Input.GetKey(KeyCode.UpArrow)) { transform.localScale += Vector3.one * resizeSpeed * Time.deltaTime; } if (Input.GetKey(KeyCode.DownArrow))…
using UnityEngine; public class ObjectPickup : MonoBehaviour { private Transform pickedUpObject; private float throwForce = 10f; private void Update() { if (Input.GetMouseButtonDown(0)) { RaycastHit hit; if (Physics.Raycast(transform.position, transform.forward, out hit,…
using UnityEngine; public class RandomColorChange : MonoBehaviour { private Material material; private void Start() { material = GetComponent<Renderer>().material; } private void Update() { if (Input.GetKeyDown(KeyCode.C)) { material.color = Random.ColorHSV(); }…