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 'control'.



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 5 results

  1. Hi guys, here is a simple script for car control which contains Gears (5) No REAR Yet Stop Lights Start / Stop Engine Fuel System [Fuel consumption in relation with RPM] RPM Editable controls Simple attach the script into your can then attach the camera the sounds and the lights.. //Script By DarkStudio [NightBird] //Version 1.0.0.0 BETA using UnityEngine; using System.Collections; public class Player : MonoBehaviour { //Variables public Light LeftStop; // Left Stop Point Light public Light RightStop; // Reght Stop Point Light public Transform Car; // Your Car Model public Transform MyCamera; // Your Camera float movespeed = 0.0F; public float fuel = 1000.0F; int gas_pedal = 0; public int health = 100; // Not Used YET int rpm = 0; int gear = 1; bool isengine = false; public KeyCode addgas = KeyCode.W; public KeyCode removegas = KeyCode.S; public KeyCode clutchkey = KeyCode.Space; public KeyCode gearup = KeyCode.UpArrow; public KeyCode geardown = KeyCode.DownArrow; public KeyCode nogear = KeyCode.Alpha0; public KeyCode firstgear = KeyCode.Alpha1; public KeyCode seccondgear = KeyCode.Alpha2; public KeyCode thirdgear = KeyCode.Alpha3; public KeyCode fourthgear = KeyCode.Alpha4; public KeyCode fifthgear = KeyCode.Alpha5; public KeyCode reargear = KeyCode.Alpha9; public KeyCode startengine = KeyCode.E; public KeyCode ChangeCameraView = KeyCode.C; public KeyCode SteerLeft = KeyCode.A; public KeyCode SteerRight = KeyCode.D; public AudioClip EngineStart; public AudioClip EngineStop; public AudioClip IdleSound; public AudioClip GasPressed; public AudioClip BreakSound; void OnGUI() { GUI.Label(new Rect(5, 20, 100, 20), "RMP : " + rpm); GUI.Label(new Rect(5, 35, 100, 20), "Fuel : " + fuel); GUI.Label(new Rect(5, 50, 100, 20), "Gear : " + gear); GUI.Label(new Rect(5, 65, 100, 20), "Engine : " + isengine); } void Update() { if (fuel <= 0) { isengine = false; rpm = 0; } if (Input.GetKeyDown(startengine)) { if (isengine == false) { if (fuel >= 1.50F) { isengine = true; fuel -= 1.5F; rpm = 1000; AudioSource.PlayClipAtPoint(EngineStart, Car.position); Debug.Log("Engine ON"); } else { Debug.Log("Not Enough Fuel!"); } } else { isengine = false; rpm = 0; Debug.Log("Engine OFF"); AudioSource.PlayClipAtPoint(EngineStart, Car.position); } } if (isengine == true) { //Fuel System if (rpm <= 1000) { fuel -= 0.025F; } else if (rpm > 1000 && rpm <= 2500) { fuel -= 0.5F; } else if (rpm > 2500 && rpm <= 4000) { fuel -= 0.8F; } else if (rpm > 4000 && rpm <= 5000) { fuel -= 1.0F; } else if (rpm > 5000) { fuel -= 1.9F; } //End Fuel //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //Steer Syste if (Input.GetKey(SteerLeft)) { if (movespeed <= 0) { } else { if (movespeed > 0F && movespeed <= 50F) { Car.transform.Rotate(Vector3.down, 2F); } else if (movespeed > 50F && movespeed < 90F) { Car.transform.Rotate(Vector3.down, 1.3F); } else if (movespeed > 90F) { Car.transform.Rotate(Vector3.down, 0.9F); } } } if (Input.GetKey(SteerRight)) { if (movespeed <= 0) { } else { if (movespeed > 0F && movespeed <= 50F) { Car.transform.Rotate(Vector3.up, 2F); } else if (movespeed > 50F && movespeed < 90F) { Car.transform.Rotate(Vector3.up, 1.3F); } else if (movespeed > 90F) { Car.transform.Rotate(Vector3.up, 0.9F); } } } //End Steer //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //Gas System if (Input.GetKey(addgas)) { if (gas_pedal <= 100) { if (movespeed <= 0) { if (gear == 1) { Car.transform.Translate(Vector3.forward * Time.deltaTime * movespeed); gas_pedal += 1; Debug.Log("GAS PRESSED " + movespeed + " " + gas_pedal + " " + fuel); Debug.Log("GAS PRESSED " + movespeed + " " + gas_pedal + " " + gear + " " + rpm + " " + fuel); AudioSource.PlayClipAtPoint(GasPressed, Car.position); } else { isengine = false; AudioSource.PlayClipAtPoint(EngineStop, Car.position); } } else { Car.transform.Translate(Vector3.forward * Time.deltaTime * movespeed); gas_pedal += 1; Debug.Log("GAS PRESSED " + movespeed + " " + gas_pedal + " " + fuel); Debug.Log("GAS PRESSED " + movespeed + " " + gas_pedal + " " + gear + " " + rpm + " " + fuel); AudioSource.PlayClipAtPoint(GasPressed, Car.position); } } else { Car.transform.Translate(Vector3.forward * Time.deltaTime * movespeed); Debug.Log("GAS PRESSED " + movespeed + " " + gas_pedal + " " + gear + " " + rpm + " " + fuel); AudioSource.PlayClipAtPoint(GasPressed, Car.position); } } else { if (gas_pedal > 0) { Car.transform.Translate(Vector3.forward * Time.deltaTime * movespeed); gas_pedal -= 1; Debug.Log("GAS PRESSED " + movespeed + " " + gas_pedal + " " + gear + " " + rpm + " " + fuel); } } if (Input.GetKeyDown(firstgear)) { gear = 1; } else if (Input.GetKeyDown(seccondgear)) { gear = 2; } else if (Input.GetKeyDown(thirdgear)) { gear = 3; } else if (Input.GetKeyDown(fourthgear)) { gear = 4; } else if (Input.GetKeyDown(fifthgear)) { gear = 5; } else if (Input.GetKeyDown(nogear)) { gear = 0; } if (Input.GetKey(removegas)) { LeftStop.enabled = true; RightStop.enabled = true; if (gas_pedal > 0.0F) { gas_pedal -= 1; AudioSource.PlayClipAtPoint(BreakSound, Car.position); } } else { LeftStop.enabled = false; RightStop.enabled = false; } //End Gas //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //RMP System if (gas_pedal >= 10 && gas_pedal <= 20) { switch (gear) { case 0: rpm = 3000; movespeed = 0.0F; break; case 1: rpm = 1800; movespeed = 8.0F; break; case 2: rpm = 1500; movespeed = 12.0F; break; case 3: rpm = 1200; movespeed = 5.0F; break; case 4: rpm = 1100; movespeed = 3.0F; break; case 5: rpm = 800; movespeed = 0.3F; break; case 9: rpm = 1700; movespeed = -9.0F; break; } } else if (gas_pedal < 10) { switch (gear) { case 0: rpm = 2000; movespeed = 0.0F; break; case 1: rpm = 1200; movespeed = 8.0F; break; case 2: rpm = 1000; movespeed = 12.0F; break; case 3: rpm = 800; movespeed = 5.0F; break; case 4: rpm = 400; movespeed = 3.0F; break; case 5: rpm = 200; movespeed = 0.3F; break; case 9: rpm = 1200; movespeed = -9.0F; break; } } else if (gas_pedal > 20 && gas_pedal <= 40) { switch (gear) { case 0: rpm = 5000; movespeed = 0.0F; break; case 1: rpm = 2800; movespeed = 14.0F; break; case 2: rpm = 2300; movespeed = 17.0F; break; case 3: rpm = 1800; movespeed = 24.0F; break; case 4: rpm = 1600; movespeed = 20.0F; break; case 5: rpm = 1200; movespeed = 15.0F; break; case 9: rpm = 2200; movespeed = -15.0F; break; } } else if (gas_pedal > 40 && gas_pedal <= 60) { switch (gear) { case 0: rpm = 7000; movespeed = 0.0F; break; case 1: rpm = 4500; movespeed = 18.0F; break; case 2: rpm = 2900; movespeed = 25.0F; break; case 3: rpm = 2400; movespeed = 35.0F; break; case 4: rpm = 2000; movespeed = 46.0F; break; case 5: rpm = 1700; movespeed = 56.0F; break; case 9: rpm = 4500; movespeed = -30.0F; break; } } else if (gas_pedal > 60 && gas_pedal <= 80) { switch (gear) { case 0: rpm = 9000; movespeed = 0.0F; break; case 1: rpm = 6500; movespeed = 24.0F; break; case 2: rpm = 4500; movespeed = 38.0F; break; case 3: rpm = 4000; movespeed = 75.0F; break; case 4: rpm = 3600; movespeed = 95.0F; break; case 5: rpm = 3000; movespeed = 120.0F; break; case 9: rpm = 4800; movespeed = -35.0F; break; } } else if (gas_pedal > 80 && gas_pedal <= 90) { switch (gear) { case 0: rpm = 14000; movespeed = 0.0F; break; case 1: rpm = 8700; movespeed = 32.0F; break; case 2: rpm = 7800; movespeed = 50.0F; break; case 3: rpm = 6700; movespeed = 106.0F; break; case 4: rpm = 4200; movespeed = 120.0F; break; case 5: rpm = 3800; movespeed = 140.0F; break; case 9: rpm = 5200; movespeed = -48.0F; break; } } else if (gas_pedal > 90 && gas_pedal <= 100) { switch (gear) { case 0: rpm = 17000; movespeed = 0.0F; break; case 1: rpm = 12700; movespeed = 42.0F; break; case 2: rpm = 8500; movespeed = 60.0F; break; case 3: rpm = 7400; movespeed = 126.0F; break; case 4: rpm = 5700; movespeed = 140.0F; break; case 5: rpm = 5200; movespeed = 180.0F; break; case 9: rpm = 8400; movespeed = -68.0F; break; } } //End RMP //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // AudioSource.PlayClipAtPoint(IdleSound, Car.position); } else { if (Input.GetKey(SteerLeft)) { if (movespeed <= 0) { } else { Car.transform.Rotate(Vector3.down, 0.4F); } } if (Input.GetKey(SteerRight)) { if (movespeed <= 0) { } else { Car.transform.Rotate(Vector3.up, 0.4F); } } LeftStop.enabled = false; RightStop.enabled = false; if (movespeed > 0) { if (!isengine) { Car.transform.Translate(Vector3.forward * Time.deltaTime * movespeed); movespeed -= 1.0F; Debug.Log("GAS PRESSED " + movespeed + " " + gas_pedal + " " + gear + " " + rpm + " " + fuel); } } } } }
  2. Hi guys, Character, moving with the mouse. But, I want to improve it. E.g, Problem ; How do we do this? So, one way?
  3. antonwe

    Unity telekinetic

    Hey guys, I'm having an issue, I'd like to have the ability in a project to lift objects using magic then fire them away. I've attempted to modify the drag rigid body code but I'd like the object to follow the middle of the screen or the character model. Also I have no idea how to shoot the object away. Any help would be great.
  4. We are currently recruiting for work on a game project, which is a first person shooter with RPG elements called "The Eye". We are a small indie development group using the Unity Game Engine and are currently seeking to fill the following roles: Lead Programmer with at least 1 yr experience with Java Script Sound Designer (please have work available to preview) Conceptual Artist Character Modeler Level Designer Writer About the game : The game takes place is a dystopian future version of the US. After the introduction of a manchurian candidate into the white house, the whole country goes into strict marshal law and 1000's of cities are virtually paralyzed. The Constitution is scrapped, those who do not join are destroyed and the spirit of the citizenry is broken. Industrialists who are loyal only to those who will advance their goals. As a result pollution increases by a 1000 fold, so much so that the streets have cabins of oxygen units to provide air to breath for the citizens. Into this world comes a group called "The Unknown", who are fighting to bring this dictatorial monarchy down. Where we are at: Currently, we are working on an alpha version of the game, testing out User Interfaces, putting a demo together and trying to bring in more people to collaborate on this and on future projects. Once we have this project complete, we are looking to publish and the members of the team will enjoy profit sharing on what we can make on the game. Contact me thru here or thru my email at itstherantman74@gmail.com Carlos
  5. Yes! A new package! After a long time too, well this is it, the Ak - 47 Tactical, probably our best gun yet, filled with specular maps, normal maps, and diffuse maps! The deadly AK! Download Verts : 4539 Faces : 2500
×
×
  • Create New...