Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

matheus_henrique1

Newbie
  • Content Count

    4
  • Joined

  • Last visited

Everything posted by matheus_henrique1

  1. Hello, I came to bring a Drone script for you hope you like it Credits: Higor-Klein Matheus-Henrique im sorry this correct name is Drone script for Photon Cloud using UnityEngine; using System.Collections; [RequireComponent(typeof(PhotonView))] public class Drone : Photon.MonoBehaviour { public float speed; private float Time; public GameObject[] Helice; public Camera camera; private bool FirstUpdate = false; private Vector3 correctPlayerPos = Vector3.zero; private Quaternion correctPlayerRot = Quaternion.identity; void Start() { if(!photonView.isMine)Destroy(camera); } void Update() { foreach(GameObject Helicee in Helice) { Helicee.transform.Rotate(0,Time.deltaTime*900,0); } if (!photonView.isMine) { if (!FirstUpdate) { FirstUpdate = true; transform.position = correctPlayerPos; transform.rotation = correctPlayerRot; } else { transform.position = Vector3.Lerp(this.transform.position, correctPlayerPos, Time.deltaTime * 5); transform.rotation = Quaternion.Lerp(transform.rotation, correctPlayerRot, Time.deltaTime * 5); } }else{ Time += Time.deltaTime; if(Time >2) { rigidbody.isKinematic = true; if(Time >2.2) { rigidbody.isKinematic = false; Time = 0; } } if(transform.rotation.z != 0 || transform.rotation.z != 0) { transform.Rotate(0,0,-Time.deltaTime*10); } transform.Rotate(Input.GetAxis("Mouse Y")*10,0,-Input.GetAxis("Mouse X")*10); if(Input.GetKey(KeyCode.W)) { if(Input.GetKey(KeyCode.LeftShift)) { transform.Translate(0,0,Time.deltaTime*speed); }else{ transform.Translate(0,0,Time.deltaTime); } } if(Input.GetKey(KeyCode.S)) { transform.Translate(0,0,0-Time.deltaTime); } if(Input.GetKey(KeyCode.A)) { transform.Translate(0-Time.deltaTime,0,0); } if(Input.GetKey(KeyCode.D)) { transform.Translate(0+Time.deltaTime,0,0); } } } public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info) { if (stream.isWriting) { stream.SendNext(transform.position); stream.SendNext(transform.rotation); } else { correctPlayerPos = (Vector3)stream.ReceiveNext(); correctPlayerRot = (Quaternion)stream.ReceiveNext(); } } }
  2. Hi var texture : Texture2D; var isNightVision = false; var fAlpha : float = 0.5; var NightVisionLight : GameObject; function Start() { NightVisionLight.active = false; } function Update() { if(Input.GetKeyDown("f")&&(isNightVision == false)) { isNightVision = true; NightVisionLight.active = true; } else if(Input.GetKeyDown("f")&&(isNightVision == true)) { isNightVision = false; NightVisionLight.active = false; } } function OnGUI() { if(isNightVision == true) { colPreviousGUIColor = GUI.color; GUI.color = new Color(colPreviousGUIColor.r, colPreviousGUIColor.g, colPreviousGUIColor.b, fAlpha); GUI.DrawTexture(Rect(0.0f, 0.0f, Screen.width, Screen.height), texture); } }
  3. Hi #pragma strict var LaserOrigin: Transform; // Put the laser (line renderer) object here. var LaserTarget: Transform; //The point light object. function Update () { var ray = new Ray(LaserOrigin.transform.position, LaserOrigin.transform.forward); //Casts a new ray var hit: RaycastHit; if(Physics.Raycast(ray, hit, Mathf.Infinity)) { LaserTarget.transform.position = hit.point; //Positions the light at the same point the laser hits something. } }
  4. Hello, my friends I bring to you a great script console for your game. Hope you like it.
×
×
  • Create New...