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

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


    • Introduce yourself
    • Discussions
    • Showcase
    • Need help?
    • Seeking team members?
    • Offtopic
    • unity3D | Example Projects
    • unity3D | Scripts
    • unity3D | Shaders
    • unity3D | Tutorials
    • 3D models
    • Animated 3D Models
    • Graphic design
    • Textures
    • Sounds
    • Other
    • FPSKit Download
    • FPSKit Modifications/Tutorials
    • FPSKit WIP/Showcase
    • Discussions / Bug reports
    • 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


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

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL





YouTube URL

Facebook URL

Twitter URL

IndieGoGo URL

Kickstarter URL


GreenLight URL



Found 22 results

  1. Johannes


    Introduction Hi, I'm Johannes Nienaber, the developer for Grunt1914. I have developed this title over the course of the last three years. In that time there has been a lot of changes and decisions toward the game and its development. At first the game was meant to have a faster development cycle but the project grew over time and became much larger than originally anticipated. Right now the game is using @themars2011's FPS MP kit for functionality but this is being heavily modified by one of our programmers. Gameplay Grunt1914 will be a very unique experience game-play wise. In some ways it features arcade style game-play themes, and in other ways it feels like a military simulation. The plan is to find the perfect balance between the two. I want the game to feel serious but fun. To show my point, there will be a mini-map and onscreen interface to add to the arcade themes yet there are also some strong simulation parts such as the weapons statistics and feel being based on their real life counterparts and a realistic movement system. These are examples of how the two styles are blended to get the feel that I want to apply. The main focus for me is fun. The game must be enjoyable to play and easily accessible. Progression The game will offer player progression in the form of military ranks based on the ranks that were used in between 1914 - 1918. As the player progresses through the ranks he/she will unlock new weapons and attachments at each new level. This gives the game a sense of achievement and will keep you coming back for more! Things that will be unlock-able will range from scopes, sights, muzzles, stands, silencers, handles, explosives, gas bombs, melee weapons and guns. Points are earned for each kill or objective that the player achieves. Nations The game will initially feature four factions. They are : - The Americans. - The British. - The Germans. - The Ottomans. These were all nations that played vital roles in the happening of the great war. Each round will have a Faction selection at the start. You can choose to either join the allies or the central powers, you will be granted a random character for the match from one of the four nations based on their faction association. Currently each nation has 2 characters that represent it. If you choose to play as the Allies for example you might get either an American or British soldier to play with for that round. As such there are eight playable characters currently. Maps Convoy District Fortitude Tutelage Turmoil Solitude Dugout Passage Conceptualization The title has had a lengthy conceptualization and prototyping phase, as such there have been many changes to various factors within the framework of the title. So far things that have changed completely from what was imagined at the inception are things like the style, theme, many of the maps, some weapons and even many attachments. Its natural for a game to change and evolve during the development cycle, Grunt1914 has seen a great deal of this. Below are some of the more recent concept art pieces created for the title. These show a clear and cohesive style and theme and were used within and for the development of the visual style of the game. Game Modes The game will feature numerous game modes. - Deathmatch - Team Deathmatch - Domination - Gungame - Capture the Flag Each game mode brings a unique feel and theme to Grunt1914. Depending on game modes rounds may last longer or shorter and the weather and time of day selection will also have vital effect on each game mode. Match Choices Grunt 1914 will not use matchmaking, it will instead revert to the old ways of finding a server and playing on it or simply setting up a server for you and your friends. The game uses cloud based server hosting through Photon and as such delivers high quality, low latency network connections. The game will have a feature that very few games have currently - in depth match choices. You will be able to set up a variety of filters for your server such as ping limits, afk limits, death timers and many more such choices. These all greatly impact the feel and style of the match you host. You will be able to select the weather and time of day for each map released in the initial version and to come in future updates. If you want the match to be on a big open map at night time with snow falling - i.e. a low visibility scenario, you can do that! If you want the map to be a small enclosed map with clear conditions and sunshine in the daytime, its up to you! This presents the host with a unique opportunity to host the match they want to play! Weapons A very important part of any shooter game is naturally the weapons. Grunt1914 aims to deliver a huge arsenal of very unique and impressive weapons to to their real life counterparts. Variety is vital! There will be a great selection of rifles, machine guns, semiautomatic machine guns, grenade launchers, shotguns, pistols, explosives, and even melee weapons! There will be over 30 weapons to use to great effect in the game! Each gun is designed to be physically and visually as close to its real life counterpart as possible. The real life statistics are recorded and implemented into game-play. These are things such as rounds per minute, velocity, muzzle flash size, range, damage, impact, recoil and so forth. Not all statistics are implemented 100% as some of them needs a bit of balancing and polishing to feel good and realistic in the game. Gunplay is naturally one the most important things in any first person shooter and Grunt1914 aims to get it right! Attachments The game will have a large variety of attachments available for the player to unlock and make use of. Things will range from scopes, sights, muzzles, stands, silencers, handles, magazine extensions, torches and many others! These will greatly enhance the game and the possibilities for each player in the match. Grunt1914 stands out in this department, its not the first game to make use of attachments but the way that it does is very unique and exiting! Many of the attachments that will be featured in the game have never featured in a video-game. This is because for many military tools and weapons WW1 was the inception of those assets. Some attachments will be marked "experimental", these were tested in WW1 and will be use-able in the game. Follow the game Facebook : https://www.facebook.com/Grunt1914/ Twitter : https://twitter.com/grunt1914 IndieDB : https://www.indiedb.com/games/grunt1914 Discord : https://discord.gg/Tc5b7D9 Youtube : https://www.youtube.com/channel/UCKfm34iEuHrFCduvV4OZpag Videos
  2. I wanna change the gun position and play running anim[In running anim the gun is swinging left and right] when Player press Right Shift key then the gun should goto running position and running rotation and when player release it then gun should come to its default position. I'm using Lerp and Quaternion in my script. I've added this script in my Parent of Gun[I hope you know what I mean See Screenshot]( Issue I have )When I press shift key then player's gun go to running position very slowly and when I release the key then gun is not coming to its initial position. So this is also causing me issue. Here is script. using UnityEngine; using System.Collections; public class Holder : MonoBehaviour { public Animation animation; public AnimationClip walk; public AnimationClip idle; public Vector3 runningPos; public Vector3 runningRot; public float lerpSpeed = 1.5f; public AnimationClip runninAnim; public Vector3 defaultPosition; void Update () { if (Input.GetAxis("Vertical") > 0.2) animation.CrossFade (walk.name); else animation.CrossFade (idle.name); if (Input.GetKey(KeyCode.RightShift)) { animation.CrossFade(runningAnim.name); this.transform.localRotation = Quaternion.Lerp(this.transform.localRotation, Quaternion.Euler(runningRot), lerpSpeed * Time.deltaTime); this.transform.localPosition = Vector3.Lerp(this.transform.localPosition, runningPos, lerpSpeed * Time.deltaTime); } else { this.transform.localPosition = Vector3.Lerp(this.transform.localPosition, defaultPosition, Time.deltaTime * lerpSpeed); } } } Thanks this is causing issue plz tell me about working script. Any help is appreciated here!
  3. AshwinTheGammer

    [Photon] I coudn't see player.

    Hello! I`m back with another question regarding Photon. I made a multiplayer FPS game. All things are working good. Only problem is I can't see another player in JoinedRoom. You can see in screenshot: Next screenshot of fpsplayer and components attached to it. And server manager script and player manager script is as follow : using UnityEngine; using System.Collections; using UnityEngine.UI; public class PhotonManager : MonoBehaviour { GameObject spawn, cam; public Text connectText; public GameObject player; void Start (){ PhotonNetwork.ConnectUsingSettings("v1.0"); spawn = GameObject.Find("SpawnPoint"); cam = GameObject.Find("MatchCam"); } void OnJoinedLobby(){ Debug.Log("JoinedLobby!"); PhotonNetwork.JoinRandomRoom(); } void Update (){ connectText.text = PhotonNetwork.connectionStateDetailed.ToString (); } void OnPhotonRandomJoinFailed (){ Debug.Log("Failed to join Room!"); RoomOptions roomOptions = new RoomOptions (){ isVisible = true, maxPlayers = 8}; int randomNum = Random.Range(0, 1000000); PhotonNetwork.CreateRoom(randomNum.ToString(), roomOptions, TypedLobby.Default); } void OnJoinedRoom (){ Debug.Log("JoinedRoom!"); Spawn(); } void Spawn (){ GameObject myPlayer = PhotonNetwork.Instantiate(player.name, spawn.transform.position, spawn.transform.rotation, 0); myPlayer.transform.FindChild("PlayerRoot").gameObject.SetActive(true); myPlayer.GetComponent<MoveController>().enabled = true; myPlayer.GetComponent<MouseController>().enabled = true; cam.GetComponent<Camera>().enabled = false; } } using UnityEngine; using System.Collections; public class PlayerManager : Photon.MonoBehaviour { Vector3 realPosition; Quaternion realRotation; //public PhotonView photonView; void Update(){ if (photonView.isMine) { } else { transform.position = Vector3.Lerp (transform.position, realPosition, .1f); transform.rotation = Quaternion.Lerp (transform.rotation, realRotation, .1f); } } void OnPhotonSerializeView (PhotonStream stream, PhotonMessageInfo info){ if(stream.isWriting){ stream.SendNext(transform.position); stream.SendNext(transform.rotation); } else { realPosition = (Vector3)stream.ReceiveNext(); realRotation = (Quaternion)stream.ReceiveNext(); } //OBserver = Unreliable //Observe Compoennt = FpsPlayermanager drag into it } } Any help is appreciated here. Please help me! please!
  4. AshwinTheGammer

    Need help with Tactical Shooter AI.

    I want to use the tactical shooter against my Player(FPSController), I had setup the scene with player and AI but it`s only shooting on me and can`t moving around so that whenever I go it follow me. I wanna make that when I shoot AI then it will take damage and when it shoot me it then I will take damage. My gun script and health script is taken from OneManArmy3d`s Au fps kit v1.5. If you want this package ask me I `ll give u. Please help me!
  5. Hello, I'm having a bit of a weird issue that I can't seem to solve. What I'm trying to do is animate my character, as a test I just want to animate the entire character (with root and everything) up and back down. However, when I set a keyframe and then add a second one, the first keyframe will now have the same value as the second keyframe. If I add a third keyframe the first and second keyframe will get the same value as third keyframe. Etc.. Why is this happening? I explained it visually here: My player has an animator controller. This happens for every bones/limb my character has, making it impossible to animate. I have some existing animations, but they don't have the proper XYZ movements of the root so I want to add them. I do seem te be able to animate an empty gameobject, but it doesn't work on my Player. My player: This is hope my player is built: Thanks in advance
  6. CakeMonsTv

    My player glitching on moving collider

    I ran into bug that i have no idea how to fix... The ship is moving up and down. My player is glitching through upper collider when it goes up as you see in this preview: https://gyazo.com/e57b5cc9007d619064a7c9b06d75c242 These are two colliders on my ship model. The bottom one is for buoyancy and the upper one is for player to walk on the ship. Could someone please help me? Thanks! https://gyazo.com/90a13dbf8e30b3d1fc299b87570f6f1e
  7. YoungDeveloper

    Simple teleport

    Hi, i helped couple people on unity answers, so i though I'd post it here. Maybe someone will find it useful, and if you aren't a good coder this will get you going. http://answers.unity3d.com/questions/514523/do-something-when-player-touches-gameobject.html Step 1. Create simple cube, and tag it "teleportPad". Place it somewhere on ground. Step 2. Create C# script called "Teleport", and paste in this code. You can translate it later in Unityscript. using UnityEngine; using System.Collections; public class Teleport : MonoBehaviour { public Transform destination; void OnControllerColliderHit(ControllerColliderHit col){ if(col.collider.gameObject.tag == "teleportPad"){ transform.position = destination.position; } } } Step 3. Save the script and attach it to player, (not camera). Step 4. Create new empty game object, place it somewhere 4 meters above the ground so you wouldn't fall through. Step 5. Drag and drop the created empty game object (created in step 4) onto "Destination", located in "Teleport" script on your player. Play it. When you will collide with the box you will be teleported to the empty game object position.
  8. CakeMonsTv

    Player damage

    I need some help with player damage script. I use AU FPS kit and i would like to make so that zombie that i added does damage to player. Any ideas on how to do that?
  9. Hello everyone! My name it's LordZER0 and im here to tell something about me and what i will do and what i do.. So let's get started: Name: LordZER0 RealName: Gabriel Roberto Years: 12 Locate: Brazil, Rio de Janeiro Like: Games! What do: Post Videos on Youtube So, that's much it.. well if you guys want more of me, comment below! and check out my channel.. Right now i posted a Sniper Montage.. If you lucky you can get on my Video! Let me just say few things before i go play Thanks: You producters of the game did an awesome job! i love it so far so good! i hope there is much more updates do this game because i Love it! so thank you guys, and thanks for everyone for saying this amazing game that has created on the web.. See'ya!
  10. Here is a free autodesk page where you can generate a free character and customize it!! You only need an autodesk acount. Click here --> charactergenerator.autodesk.com

    Create Shadow of Player

    Hello Everybody I would like to know how to make a body shadow for a FPS. Thanks .

    Player Shadow

    I moved the question to http://armedunity.com/topic/11761-create-shadow-of-player/.
  13. orlamocorp

    Multiplayer User Manager Question

    Hello everybody, my question is : How I do a system to when any player join in the room(network), instantiate a UserManager which will contain him Kills/Deaths in the actual room, and when the player dies, this informations(kills/deaths) won't be lost? I'm using Unity 3D Networking, not Photon. Thanks
  14. Hey , I was going through some old scripts and I found this which I thought someone might use possibly so , here you go. *This script was not made by me it was only edited by me , its 2 scripts that I put together (both scripts are CCO so there is no infringement at least). var limitDiagonalSpeed = true; var toggleRun = false; var jumpSpeed = 8.0; var gravity = 20.0; var fallingDamageThreshold = 10.0; var slideWhenOverSlopeLimit = false; var slideOnTaggedObjects = false; var slideSpeed = 12.0; var airControl = false; var antiBumpFactor = .75; var antiBunnyHopFactor = 1; private var moveDirection = Vector3.zero; private var grounded = false; private var controller : CharacterController; private var myTransform : Transform; private var speed : float; private var hit : RaycastHit; private var fallStartLevel : float; private var falling = false; private var slideLimit : float; private var rayDistance : float; private var contactPoint : Vector3; private var playerControl = false; private var jumpTimer : int; var curStam : float = 100.0; var maxStam : float = 100.0; var isSprinting : boolean = false; var StaminaBarFG : Texture2D; var StaminaBarBG : Texture2D; var staminaBarLength : float; var percentOfStamina : float; var stamCooldown : boolean = false; function Start () { controller = GetComponent(CharacterController); myTransform = transform; speed = walkSpeed; rayDistance = controller.height * .5 + controller.radius; slideLimit = controller.slopeLimit - .1; jumpTimer = antiBunnyHopFactor; oldPos = transform.position; } function FixedUpdate() { var inputX = Input.GetAxis("Horizontal"); var inputY = Input.GetAxis("Vertical"); var inputModifyFactor = (inputX != 0.0 && inputY != 0.0 && limitDiagonalSpeed)? .7071 : 1.0; if (grounded) { var sliding = false; if (Physics.Raycast(myTransform.position, -Vector3.up, hit, rayDistance)) { if (Vector3.Angle(hit.normal, Vector3.up) > slideLimit) sliding = true; } else { Physics.Raycast(contactPoint + Vector3.up, -Vector3.up, hit); if (Vector3.Angle(hit.normal, Vector3.up) > slideLimit) sliding = true; } if (falling) { falling = false; if (myTransform.position.y < fallStartLevel - fallingDamageThreshold) FallingDamageAlert (fallStartLevel - myTransform.position.y); } if (!toggleRun) speed = Input.GetButton("Run")? runSpeed : walkSpeed; if ( (sliding && slideWhenOverSlopeLimit) || (slideOnTaggedObjects && hit.collider.tag == "Slide") ) { var hitNormal = hit.normal; moveDirection = Vector3(hitNormal.x, -hitNormal.y, hitNormal.z); Vector3.OrthoNormalize (hitNormal, moveDirection); moveDirection *= slideSpeed; playerControl = false; } else { moveDirection = Vector3(inputX * inputModifyFactor, -antiBumpFactor, inputY * inputModifyFactor); moveDirection = myTransform.TransformDirection(moveDirection) * speed; playerControl = true; } if (!Input.GetButton("Jump")) jumpTimer++; else if (jumpTimer >= antiBunnyHopFactor) { moveDirection.y = jumpSpeed; jumpTimer = 0; } } else { if (!falling) { falling = true; fallStartLevel = myTransform.position.y; } if (airControl && playerControl) { moveDirection.x = inputX * speed * inputModifyFactor; moveDirection.z = inputY * speed * inputModifyFactor; moveDirection = myTransform.TransformDirection(moveDirection); } } moveDirection.y -= gravity * Time.deltaTime; grounded = (controller.Move(moveDirection * Time.deltaTime) & CollisionFlags.Below) != 0; } function Update () { if (toggleRun && grounded && Input.GetButtonDown("Run")) speed = (speed == walkSpeed? runSpeed : walkSpeed); percentOfStamina = curStam/maxStam; staminaBarLength = percentOfStamina*100; if(Input.GetKey("left shift") && curStam > 0 && stamCooldown == false ) { runSpeed = 20.0; isSprinting = true; } else { runSpeed = walkSpeed; isSprinting = false; } if(isSprinting == true && curStam >= 0) { curStam--; } if(isSprinting == false && curStam < 100.0) { curStam++; } if(curStam == 0) { stamCooldown = true; } if(curStam == 100.0) { stamCooldown = false; } } function OnControllerColliderHit (hit : ControllerColliderHit) { contactPoint = hit.point; } function FallingDamageAlert (fallDistance : float) { Debug.Log ("Ouch! Fell " + fallDistance + " units!"); } function OnGUI () { GUI.DrawTexture(Rect((Screen.width/2) - 100, 10, staminaBarLength * 2, 10), StaminaBarFG); GUI.DrawTexture(Rect((Screen.width/2) - 100, 10, 200, 10), StaminaBarBG); } @script RequireComponent(CharacterController)
  15. So here's the deal, basically in my game i'm having a huge open world and am having the player spawn at a random spawnPoint, in the open world. But the thing is is that i'm using GameObject.FindGameObjectsWithTag to find the spawn points (them i'm adding them in a array) I'm having my player instantiate at one of the spawn point in the array, only thing is I keep getting this message: NullReferenceException: Object reference not set to an instance of an object Spawn Manager.Spawn () (at Assets/Spawn Manager.js:16) Spawn Manager.Start () (at Assets/Spawn Manager.js:8) I checked within the code and am very confused, i'm sill learning this stuff and to the people who really know this, this question probably sounds stupid. But I still can't find the problem that Unity is talking about, I have a very short and simple script. Here it is: var spawnPoints : GameObject[]; // Array for Player's spawn var PlayerPrefab : GameObject; // Player Prefab to spawn function Start(){ spawnPoints = GameObject.FindGameObjectsWithTag("PlayerSpawn"); Spawn(); } function Spawn(){ var obj : GameObject = PlayerPrefab; var pos: GameObject = spawnPoints[Random.Range(0, spawnPoints.length)]; // Randomize Spawn Points Instantiate(obj, pos.position, pos.rotation); } See? Not much. The SpawnPoints I currently have in-game are tagged with "PlayerSpawn" but I know that's not the issue. And I'm sure i'm being just stupid with the issue here and i'm also sure that there's a easy way around this but that's why i'm asking for help, (So I can learn this stuff and get better) If anyone can help me figure this out much would be appreciated. Thanks!
  16. How to add custom player to the OMA kit ? Thanks! popolo.
  17. Hallo guys i am totaly new to javascript and C# but i tried making somefhing fast just to see what i have learned And so i think i should share it with you guys Player Script: static var MyHealth = 100; var MyDamage = 50; function Update () { if(MyHealth == 0) Die(); } function Die () { Destroy(this.gameObject); } function OnGUI () { GUILayout.Label("Health: " + MyHealth); } function OnTriggerEnter () { Debug.Log("KILLED ENEMY !!"); Enemy.EnemyHealth -= MyDamage; Enemy Script: #pragma strict static var EnemyHealth = 100; var EnemyDamage = 50; function Start () { } function Update () { if(EnemyHealth == 0) Destroy(this.gameObject); } function OnTriggerEnter() { damage.MyHealth -= EnemyDamage; } I know this is not the best but i tried :/
  18. hey Guys I just made a Script called "Hunger". (All two Scripts are JavaScripts) It is very simple and like a Hunger and health Bar with GUI Texture. If you add the Hunger Script to the Player there will stand nothing because you have to add a GUI Texture for the Hunger and the Health Bar. If the hunger is higher then 85 Points the player will be given 3 Live Points every Second. When the hunger is 0 your health will decrease by 3 every Second. here is the Script. Translations: Lebenstärke = Health Satt = Hunger Balkenlange = how longe the bar should be. Script: var Health : int = 100; var MaxHealth : int = 100; var Hunger : int = 100; var Timer : float; var Texture1 : Texture2D; var Texture2 : Texture2D; var BarLength : int = 100; private var Speed : int = 3; function Update () { Health = Mathf.Clamp(Health, 0, MaxHealth); if(Health > 0){ Timer += Time.deltaTime; if(Timer >= Speed) { if(Hunger >= 85) { Health += 3; } if(Hunger <= 0){ Health -= 1; Speed = 1; } else { ​ Hunger -= 1; Speed = 3; } Timer = 0; } } } function OnGUI () { GUI.DrawTexture(Rect(400,400,100*Hunger/BarLength,20),Texture1); GUI.DrawTexture(Rect(400,430,100*Health/BarLength,20),Texture2); }
  19. Clunk

    Image video player

    Hey guys. I'm making kind of like a GIF image to make a cut scene. (I'm going to make a live action cut scene soon I know...... It's awesome) But I'm pretty sure that unity 3D doesn't support GIF's. So I was wondering if its possible to play the images in an order really fast? So it will be like a movie If someone could help that you be great. Thanks -Stuart
  20. How can I use Objectlabel script over network (I'm using FPS Multiplayer kit) ?? Objectlabel Script: http://wiki.unity3d.com/index.php?title=ObjectLabel
  21. jmaster2012

    Single Player Login System

    Hello! I have coded a Login system in java. It is only Single Player, but it works well. Enjoy! var mySkin : GUISkin; var GeneralWidth = 73; // Width for most bottons should be the same. Use GeneralWidth. Use there custom Width if needed. var LoaderHeight = 10; var LoaderWidth = 10; var LogHeight = 101; var LogWidth = 163; var PlayerUsername = ""; var PlayerPassword = ""; var UserHeight = 35; var UserWidth = 1; var PassHeight = 65; var PassWidth = 1; var GameOwner = ""; var GameOwnerPassword = ""; var UsernameCORRECT = false; var PasswordCORRECT = false; var onSave : boolean = false; var Incorrect : boolean = false; var LogIn : boolean = false; var wrong : boolean = false; var waitTime : int = 3; function Start () { GameOwner = (PlayerPrefs.GetString("GameOwner")); GameOwnerPassword = (PlayerPrefs.GetString("GameOwnerPassword")); } function Update (){ // Updates each frames and checks if the TextArea is equal to the username we want if (PlayerUsername == GameOwner){ UsernameCORRECT = true; } else { UsernameCORRECT = false; } // Updates each frames and checks if the TextArea is equal to the password we want if (PlayerPassword == GameOwnerPassword){ PasswordCORRECT = true; } else { PasswordCORRECT = false; } if(onSave) { PlayerPrefs.SetString("GameOwner", GameOwner); PlayerPrefs.SetString("GameOwnerPassword", GameOwnerPassword); } } function OnGUI () { // Assign a skin to you menu GUI.skin = mySkin; // Background box GUI.Box (Rect (LoaderHeight,LoaderWidth,220,120), "Log-in"); //Text area for the username PlayerUsername = GUI.TextArea (Rect(GeneralWidth,UserHeight,100,20),PlayerUsername); //Text area for the password PlayerPassword = GUI.TextArea (Rect(GeneralWidth,PassHeight,100,20),PlayerPassword); // Loads level (0). This map can be set in the build settings if (GUI.Button (Rect (LogWidth,LogHeight,60,25), "Log-In")) { LogIn = true; if(UsernameCORRECT == true && PasswordCORRECT == true) { Application.LoadLevel(2); } else { Incorrect = true; wrong = true; } } if(GUI.Button (Rect (100,101,60,25), "Register")) { GameOwner = PlayerUsername; GameOwnerPassword = PlayerPassword; onSave = true; } if(Incorrect == true && LogIn == true) { if(wrong == true) { IncorrectGUI(); } } } function IncorrectGUI() { GUI.color = Color.red; GUI.Label (Rect (LogWidth,LogHeight + 30,200, 200), "Incorrect username or password"); yield WaitForSeconds(waitTime); wrong = false; } single_player_login.zip
  22. Hey Guys I just wrote a new script for my player for my game but I have a problem I wrote the script in JavaScript and made a GUI.DrawTexture that the player can see his health but it wont work can anybody help me? Script: var currentGun : GameObject; var distToPickUpGun : float = 6; var throwGunUpForce : float = 100; var throwGunForwardForce : float = 300; var waitFrameForSwitchGuns : int = -1; var walkAcceleration : float = 5; var walkAccelAirRacio : float = 0.1; var walkDeacceleration : float = 5; @HideInInspector var walkDeaccelerationVolx : float; @HideInInspector var walkDeaccelerationVolz : float; var cameraObject : GameObject; var maxWalkSpeed : float = 20; @HideInInspector var horizontalMovement : Vector2; var jumpVelocity : float = 20; @HideInInspector var grounded : boolean = false; var maxSlope : float = 60; var crouchRacio : float = 0.3; var transitionToCrouchSec : float = 0.2; var crouchingVelocity : float; var currentCrouchRacio : float = 1; var originalLocalScaleY : float; var crouchLocalScaleY : float; var collisionDetectionSphere : GameObject; @HideInInspector var waitToPickupAmmo : float = 0; var currentCell : GameObject; var health : float = 3000; var deadBodyPrefab : GameObject; var BarLength : int = 100; var Texture2 : Texture2D; function Awake () { currentCrouchRacio = 1; originalLocalScaleY = transform.localScale.y; crouchLocalScaleY = transform.localScale.y * crouchRacio; } function LateUpdate () { if (grounded) rigidbody.useGravity = false; else rigidbody.useGravity = true; waitFrameForSwitchGuns -= 1; waitToPickupAmmo -= Time.deltaTime; transform.localScale.y = Mathf.Lerp(crouchLocalScaleY, originalLocalScaleY, currentCrouchRacio); if (Input.GetButton("Crouch")) currentCrouchRacio = Mathf.SmoothDamp(currentCrouchRacio, 0, crouchingVelocity, transitionToCrouchSec); if (Input.GetButton("Crouch") == false && collisionDetectionSphere.GetComponent(CollsionDetectionSphereScript).collisionDetected == false) currentCrouchRacio = Mathf.SmoothDamp(currentCrouchRacio, 1, crouchingVelocity, transitionToCrouchSec); horizontalMovement = Vector2(rigidbody.velocity.x, rigidbody.velocity.z); if (horizontalMovement.magnitude > maxWalkSpeed) { horizontalMovement = horizontalMovement.normalized; horizontalMovement *= maxWalkSpeed; } rigidbody.velocity.x = horizontalMovement.x; rigidbody.velocity.z = horizontalMovement.y; if (grounded){ rigidbody.velocity.x = Mathf.SmoothDamp(rigidbody.velocity.x, 0, walkDeaccelerationVolx, walkDeacceleration); rigidbody.velocity.z = Mathf.SmoothDamp(rigidbody.velocity.z, 0, walkDeaccelerationVolz, walkDeacceleration);} transform.rotation = Quaternion.Euler(0, cameraObject.GetComponent(MouseLookScript).currentYRotation, 0); /*if (grounded) rigidbody.AddRelativeForce(Input.GetAxis("Horizontal") * walkAcceleration * Time.deltaTime, 0, Input.GetAxis("Vertical") * walkAcceleration * Time.deltaTime); else rigidbody.AddRelativeForce(Input.GetAxis("Horizontal") * walkAcceleration * walkAccelAirRacio * Time.deltaTime, 0, Input.GetAxis("Vertical") * walkAcceleration * walkAccelAirRacio * Time.deltaTime); */ if (Input.GetButtonDown("Jump") && grounded) rigidbody.AddForce(0,jumpVelocity,0); if (health <= 0) { currentGun.GetComponent(GunScript).beingHeld = false; currentGun.rigidbody.AddRelativeForce(Vector3(0, throwGunUpForce, throwGunForwardForce)); Instantiate(deadBodyPrefab, transform.position, transform.rotation); collider.enabled = false; cameraObject.GetComponent(AudioListener).enabled = false; enabled = false; } } function FixedUpdate () { if (grounded) rigidbody.AddRelativeForce(Input.GetAxis("Horizontal") * walkAcceleration, 0, Input.GetAxis("Vertical") * walkAcceleration); else rigidbody.AddRelativeForce(Input.GetAxis("Horizontal") * walkAcceleration * walkAccelAirRacio, 0, Input.GetAxis("Vertical") * walkAcceleration * walkAccelAirRacio); } function OnCollisionStay (collision : Collision) { for (var contact : ContactPoint in collision.contacts) { if (Vector3.Angle(contact.normal, Vector3.up) < maxSlope) grounded = true; } } function OnCollisionExit () { grounded = false; } function OnTriggerExit () { currentCell = null; } function OnTriggerStay (hitTrigger : Collider) { if (hitTrigger.tag == "AIpathCell") currentCell = hitTrigger.gameObject; if (hitTrigger.transform.tag == "StairGoingUp") if (!Input.GetButton("Jump") && Vector3.Angle(rigidbody.velocity, hitTrigger.transform.forward) < 90) if (rigidbody.velocity.y > 0) rigidbody.velocity.y = 0; if (hitTrigger.transform.tag == "StairGoingDown") if (!Input.GetButton("Jump") && Vector3.Angle(rigidbody.velocity, hitTrigger.transform.forward) < 90) rigidbody.AddForce(0,-100,0); var current : GunScript = null; if (currentGun) current = currentGun.GetComponent(GunScript); var ammo : AmmoPickupScript = null; var gun : GunScript = null; if (hitTrigger.tag == "AmmoPickup" && waitToPickupAmmo <= 0) { ammo = hitTrigger.gameObject.GetComponent(AmmoPickupScript); if (current.currentExtraAmmo < current.maxExtraAmmo) { if (ammo.fromGun) { gun = ammo.gun.GetComponent(GunScript); if (gun.currentExtraAmmo > 0 && gun.ammoType == current.ammoType && ammo.gun != currentGun) { if (gun.currentExtraAmmo >= current.maxExtraAmmo - current.currentExtraAmmo) { gun.currentExtraAmmo -= current.maxExtraAmmo - current.currentExtraAmmo; current.currentExtraAmmo = current.maxExtraAmmo; } if (gun.currentExtraAmmo < current.maxExtraAmmo - current.currentExtraAmmo) { current.currentExtraAmmo += gun.currentExtraAmmo; gun.currentExtraAmmo = 0; } if (ammo.pickupSound) ammo.gameObject.GetComponent(AudioSource).Play(); } } if (!ammo.fromGun) { if (current.ammoType == ammo.ammoType || ammo.ammoType == -1) { if (ammo.ammoAmount > 0 && !ammo.unlimitedAmmo) { if (ammo.ammoAmount >= current.maxExtraAmmo - current.currentExtraAmmo) { ammo.ammoAmount -= current.maxExtraAmmo - current.currentExtraAmmo; current.currentExtraAmmo = current.maxExtraAmmo; } if (ammo.ammoAmount < current.maxExtraAmmo - current.currentExtraAmmo) { current.currentExtraAmmo += gun.currentExtraAmmo; ammo.ammoAmount = 0; } if (ammo.pickupSound) ammo.gameObject.GetComponent(AudioSource).Play(); } if (ammo.unlimitedAmmo) { current.currentExtraAmmo = current.maxExtraAmmo; if (ammo.pickupSound) ammo.gameObject.GetComponent(AudioSource).Play(); } } } } } } function OnGUI () { GUI.DrawTexture(Rect(400,430,100*health/BarLength,20),Texture2); }