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.

Search the Community

Showing results for tags 'door'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • GENERAL
    • Introduce yourself
    • Discussions
    • Showcase
    • Need help?
    • Seeking team members?
    • Offtopic
  • RESOURCES
    • Example Projects
    • Scripts
    • Shaders
    • Unity Tutorials
    • FPS Kit Tutorials
    • 3D models
    • Animated 3D Models
    • Graphic design
    • Textures
    • Sounds
    • Other
  • SELL | REQUEST
    • Sell
    • Request
  • Mars' Modular Multiplayer Photon FPS Kit's Topics
  • Mars' Modular Multiplayer Photon FPS Kit's Reviews
  • Mars' Modular Multiplayer Photon FPS Kit's Updates
  • Mars' Modular Multiplayer Photon FPS Kit's Tutorials
  • Busy People's Introductions
  • Photon's Tutorials
  • Photon's Photon General
  • Photon's Showcase

Categories

  • Free Projects
  • Free Assets
  • Game Demos
  • Photon's Files

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


YouTube URL


Facebook URL


Twitter URL


IndieGoGo URL


Kickstarter URL


IndieDB URL


GreenLight URL


Location:


Interests

Found 6 results

  1. I made a door script for anyone to use, and I have also included a prefab to easily put in your game. doorDemoAssets.unitypackage
  2. This is for a door that i just spiffed up. Is it good? also i have a thing where it makes a scene "Dont Destory on Load" and its really screwing me in da but. anyways.. here DoorPrefab.zip
  3. Hey guys , Plz i need help with my door/key scripts , the scripts works very well But when i pickup a key it can opens all the doors , a friend says that i need ints to multiple keys/doors but i dunno how to do it so plz help , there is the scripts : Key #pragma strict static var HaveKey : boolean = false; function Start () { } function Update () { } function OnTriggerStay (Player : Collider){ if(Input.GetKey(KeyCode.E)){ HaveKey = true; } } Door //Booleans: var IsOpen : boolean = false; var CanOpen : boolean = false; var NeedKey : boolean = true; var DoorInt : int; //Audios: var Locked : AudioClip; var Open : AudioClip; //Other: var Volume : float = 0.5; var KeyScript : GameObject; function Start () { audio.volume = Volume; } function Update () { if(Input.GetKeyUp(KeyCode.E) && !IsOpen && CanOpen && !NeedKey) { Opening(); IsOpen = true; audio.clip = Open; audio.Play(); } else if(Input.GetKeyUp(KeyCode.E) && IsOpen && CanOpen && !NeedKey) { Closing(); IsOpen = false; } else if(Input.GetKeyUp(KeyCode.E) && CanOpen && NeedKey) { audio.clip = Locked; audio.Play(); } if(KeyScript.GetComponent(Key).HaveKey == true) { NeedKey = false; } } function Opening() { for (var i = 0; i < 100; i++) { transform.Rotate(0,0.9,0); yield WaitForSeconds(0.01); } } function Closing() { for (var i = 0; i < 100; i++) { transform.Rotate(0,-0.9,0); yield WaitForSeconds(0.01); audio.clip = Open; audio.Play(); } } function OnTriggerEnter (other : Collider) { if(other.gameObject.tag == "Player") { CanOpen = true; } } function OnTriggerExit (other : Collider) { if(other.gameObject.tag == "Player") { CanOpen = false; } } @script RequireComponent(AudioSource)
  4. Hi everyone, I have a problem with making a door. I know how to create a animation for it (I made an empty gameobject and used it as a rotation point). But It never works correctly, I tried so many diffrent scripts an tutorials but it never works. So, does someone know a easy script for open and closing a door? Thanks
  5. Hey guys, So I have this door script (It's actually not mine I got it from desert fortress pack) and I'm using it with the FPS kit By OMA. I can't figure out how to add the "press e to use" gui that is on the weapon pickup and stuff. I want to figure out a way to add that gui to the door. Thanks! using UnityEngine; using System.Collections; //Instruction: //Make an empty game object and call it "Door" //Rename your 3D door model to "Body" //Parent a "Body" object to "Door" //Make sure thet a "Door" object is in left down corner of "Body" object. The place where a Door Hinge need be //Add a box collider to "Door" object and make it much bigger then the "Body" model, mark it trigger //Assign this script to a "Door" game object that have box collider with trigger enabled //Press "e" (Default) to open and close the door //Make sure the main character is tagged "player" public class open_door : MonoBehaviour { public float smooth = (float)2.0; public float DoorOpenAngle = (float)110.0; public float DoorCloseAngle = (float)0.0; public bool open = false; public bool enter = false; public string defined_key = "e"; // Update is called once per frame void Update () { if(open == true) { var target = Quaternion.Euler (transform.localRotation.x, DoorOpenAngle, transform.localRotation.z); // Dampen towards the target rotation transform.localRotation = Quaternion.Slerp(transform.localRotation, target, Time.deltaTime * smooth); } if(open == false) { var target1 = Quaternion.Euler (transform.localRotation.x, DoorCloseAngle, transform.localRotation.z); // Dampen towards the target rotation transform.localRotation = Quaternion.Slerp(transform.localRotation, target1, Time.deltaTime * smooth); } if(enter == true) { if(Input.GetKeyDown(defined_key)) { open = !open; } } } //Activate the Main function when player is near the door void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Player") { //Debug.Log("Trigger Enter"); (enter) = true; } } //Deactivate the Main function when player is go away from door void OnTriggerExit (Collider other) { if (other.gameObject.tag == "Player") { //Debug.Log("Trigger Exit"); (enter) = false; } } //@youtube.com/user/maksimum654321 }
  6. Kaz

    Door script

    I really shouldn't have to explain anything besides the title; there's nothing complicated about it. IMPORTANT : You need to have animations already attached to the door. Select the game object with the animation for Door For Block you use a Normal Cube without a mesh renderer; the script finds the Box Collider and disables it, select the GameObject for Block. /IMPORTANT I have this set up for my stealth game in which LeftShift is the sprint and E cracks the door so you can see through it barely. Never mind, I decided to change it to keep my reputation from being full on lazy It's a very simple script, you can easily change the coding. I got c++ coding skills, so if you get any errors I can help var Open : String = "Open"; var Close : String = "Close"; var Block : GameObject; var DoorOpen = false; //Don't change this or I will find you, and hunt you down. var Door : GameObject; function OnTriggerStay (other : Collider) //function OnTriggerEnter (other : Collider) { if(DoorOpen == false){ if(Input.GetKeyDown(KeyCode.E)) { Block.GetComponent(BoxCollider).enabled = false; Door.animation.Play(Open); DoorOpen = true; yield WaitForSeconds(3.0); } } if(DoorOpen == true){ if(Input.GetKeyDown(KeyCode.E)) { Block.GetComponent(BoxCollider).enabled = true; Door.animation.Play(Close); DoorOpen = false; yield WaitForSeconds(3.0); //So you can't open and close the door before the animation is finished } } }
×
×
  • Create New...