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

  • 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
    • unity3D | Example Projects
    • unity3D | Scripts
    • unity3D | Shaders
    • unity3D | Tutorials
    • 3D models
    • Animated 3D Models
    • Graphic design
    • Textures
    • Sounds
    • Other
  • FREE FPS PROJECT
    • FPSKit Download
    • FPSKit Modifications/Tutorials
    • FPSKit WIP/Showcase
    • Discussions / Bug reports

Categories

  • Free Projects
  • Free Assets
  • Game Demos

Blogs

  • MajesticMahir's Blog
  • Official Renegrad Studios Blog
  • Bibbobbib's Blog
  • Special Ops Official Page
  • Altered Planet Studios' Blog
  • Fallen Nation FPS
  • DarkParadise offical blog
  • RiseFrame Updates
  • MobileRPG
  • Wonderland
  • technoshaman's Blog
  • Diab0lical
  • Fantasy MMORPG Blog
  • NXTGenerationsTV's Blog
  • Terrain Creator
  • andyman1995's Blog
  • TheRockeR93's Model Blog!
  • Armed Assault: The Fall
  • Unique Game Concepts
  • soulreafers blog
  • 314 Arts Devlogs
  • My all about all blog )

Calendars

  • Community Calendar

Facebook URL


Twitter URL


IndieGoGo URL


Kickstarter URL


IndieDB URL


GreenLight URL


Location:


Interests

Found 186 results

  1. free unity project is provided by armedunity name is Au Fpskit 1.5 I want to know how to add enemy to that project please help guys
  2. Hello i have probleme . on my game i want to add AI , i have tactical shooter AI but i dont know how to integrate this asset on my game , i have try but i never do damage to the AI . Somone can help me pls ? Thank.Insert other media
  3. Hello, i'm trying to make a RPG game with multiplayer, not so hard with what i can program so far. But what im really struggling about is Third Person controller Animator help, i dont want to use the default TPC (Third Person Controller) that comes with Unity Standard Assets. I want to create my own, by using the Male Locomotion pack from Mixamo.com, then i search around on how to make a simple third person controller, and then there are a lot of good videos. But one problem is in every video, the problem is that i dont want to use the Walk_Turn or Run_Turn animations for turning while walking or running, i want to have a free camera so if i change my view to the right with right mouse button then the character will run or walk that direction. The camera of course follows the character behind. So this is what i really am asking help for : -Simple Animator with c# script -FreeCameraLook.cs script -Character walking the direction the camera is pointing (Can only run / walk on the X axis or Z axis, not up or down) Thanks in advance if someone find good tutorials and post them down in the comment section, and of course thanks a lot for those who try to help!
  4. Hello world. Im here to ask one question and hopefully people will write back and take their time to reed this. So my question to the programmers out there is, whats, where and how is the best way to learn Unity C# programming. When i say C# Programming i also mean Network Programming, it is completly okey and ill be really thankful if there isn't a really good unity3d network programming tutorial but only the other type of programming. Anything helps out! I have searched around a lot a lot of to learn programming networking, but don't find so much useful tutorials. I can program a little bit, i have made a basic FPS game by my self and it is really cool in my opinion, but it is boring to play a game where you can't do much but walk around and shoot Ai. So i really wanted to learn Network Programming. Then came this beautiful thing called Unet, or maybe it is old, i dont know, when i say Unet i mean all the new networking components. My experience with multiplayer : The only thing i have completed by using Unet, is making a player join by the NetworkManager / NetworkManagerHUD and walk around and look around in a FPS type of view. And it worked / works. That wasn't so advanced and hard to program, so i thought that it wouldn't be so hard to program in other things like shooting, switching weapons and so on. Oh God it was. So then i ran into this type of thing called [Command] //or Cmd This was new, and it will be new and never be understood by me. I am talking about a lot of other commands and words in Unet programming, but these are the first ones i ran into. So my question is, is there really any good and useful tutorials / streams / courses or whatever it can be, that will help you out in Unity3D C# Programming and Unity3D C# Network Programming ? Thanks in advance for reading all this, thank you for your time and i hope you have a good answer and i hope you have a wonderful day
  5. buddy i need to know how to change FPS hands to FPS model like "Max" with full body?
  6. Guys i have found a nice template but i don't know is this a fake/Virus downlod? can one of you test it? Link to the site: REMOVED Thanks
  7. Hi guys and girls ! I have a problem with... low poly works. This type modelling is wrong for low-polygon ? MAYA I want to make cartoony looking environments but ı don't understand something or... Why can't make soft edge for low poly or black sections isn't problem or ı don't understand how to make low poly ? We using hard surface ? Yes ım never make low poly works !!! seriously Thank you...
  8. Hi, I wanna remove the function that goes over, what code should I remove/change on FPSController.cs? https://youtu.be/CGDkDKmpcJA
  9. Can someone tell me how do i repeat something like a function each X second? Till now i ve been using something like this but it is not very "professional" private float totalTime = 3; private float countdown = 3; //I used this to repeat something each 3 sec void Update() { countDown -= Time.Deltatime; if(countDown <= totalTime) { countDown = totalTime; Debug.Log("Hello World"); } } Help please, im just a begginer
  10. I did something to cause this i think but i don't know what... I was messing around with the lights i think
  11. So I freshly installed Windows, and downloaded Unity. I installed it and restarted my computer, and when I went to create a new project, it is a dark theme but I have personal edition What could be causing this?
  12. Hello everyone! I am having a bit of trouble with this Inventory System. My game is going fine but the only problem is that playing it would be pointless because the Inventory doesn't even save! If anyone knows how to implement saving please help! and I know the script is big sorry . Thanks SCRIPT : using UnityEngine; using System.Collections; using System.Collections.Generic; public class Player : MonoBehaviour { public Transform myTransform; public Transform myBody; public Transform myHips; public Transform mySpine; public Transform myCamera; public Transform mySpawnpoint; public List<Transform> myItems; private Multiplayer multiplayer; private Transform[] myArray; private CharacterMotor myCharMotor; public Texture2D[] CrossHairs; public Inventory myInventory; public GameObject[] AttackPrefabs; private ItemDatabase db; public float nextUseTime; public float myHealth; public const float MAX_HEALTH = 100; public float healthRegen; public float prevHealth; public bool hitted = false; public bool bleeding = false; public const float MAX_STATS = 100; public float myHunger; public float hungerTake; public float myThirst; public float thirstTake; public float arrowForce = 600.0f; private Texture2D texture_background; private Texture2D texture_hotbar; private Texture2D texture_inventory; private Texture2D texture_crafting; private Texture2D image; private Texture2D recipes; public bool isInventoryOpen = false; public float screenSizeMultiplier = 0.6f; public InventoryItem selectedItem; public Vector2 selectedPos; private Vector2 btnSize; private Vector2 mousePos; public GUISkin skin; void Start() { //Load myObjects myArray = new Transform[5]; myItems = new List<Transform>(); myTransform = transform; myArray[0] = myTransform; myBody = myTransform.FindChild("body"); myArray[1] = myBody; myHips = myBody.FindChild("Hips"); myArray[2] = myHips; mySpine = myHips.FindChild("Spine").FindChild("Spine1").FindChild("Spine2"); myArray[3] = mySpine; myCamera = mySpine.FindChild("MainCamera"); myArray[4] = myCamera; mySpawnpoint = myCamera.FindChild("Spawnpoint"); myCharMotor = myTransform.GetComponent<CharacterMotor>(); /***********************************/ //Select all items Transform itemHolder = mySpine.FindChild("RightShoulder").FindChild("RightArm").FindChild("RightForeArm").FindChild("RightHand").FindChild("Items"); foreach(Transform c in itemHolder) { myItems.Add(c); } EnableDisableItems(-1, false); //Disable all items. //Set default health options myHealth = 100; healthRegen = 1.3f; prevHealth = 100; //Set default hunger and thirst myHunger = 100; myThirst = 100; thirstTake = 0.1f; hungerTake = 0.01f; //Load Crosshairs CrossHairs = new Texture2D[3]; CrossHairs[0] = (Texture2D)Resources.Load("Textures/Crosshairs/Crosshair1"); //Default crosshair //Load GUI Textures texture_background = (Texture2D)Resources.Load("Textures/HUD/background"); texture_hotbar = (Texture2D)Resources.Load("Textures/HUD/hotbar"); texture_inventory = (Texture2D)Resources.Load("Textures/HUD/inventory"); texture_crafting = (Texture2D)Resources.Load("Textures/HUD/crafting"); recipes = (Texture2D)Resources.Load("Textures/HUD/recipes"); //Setup new Inventory myInventory = new Inventory(); selectedItem = InventoryItem.NULL; //Get db db = GameObject.Find("MPManager").GetComponent<ItemDatabase>(); multiplayer = GameObject.Find("MPManager").GetComponent<Multiplayer>(); btnSize = new Vector2(70.5f, 70.5f); if(GetComponent<NetworkView>().isMine) { InvokeRepeating("ThirstAndHungerController", 0, 1); } InvokeRepeating("UpdateSoundSettings", 0, 3); } void Update() { HealthController(); EquipmentController(); if(GetComponent<NetworkView>().isMine) { EquipmentUse(); } AnimationController(); } void UpdateSoundSettings() { GetComponent<AudioSource>().volume = multiplayer.GetComponent<AudioSource>().volume; } void HealthController() { if (myHealth < MAX_HEALTH) { if(bleeding) { myHealth -= healthRegen * Time.deltaTime; } else { myHealth += healthRegen * Time.deltaTime; } } if(myHunger > 80 && myThirst > 80) { healthRegen = 2.2f; } if (myHealth > MAX_HEALTH) { myHealth = MAX_HEALTH; } if (myHealth < 1 && GetComponent<NetworkView>().isMine) { GameObject.Find("SpawnManager").GetComponent<SpawnManager>().isDead = true; Network.RemoveRPCs(Network.player); GetComponent<NetworkView>().RPC("DestroySelf", RPCMode.All); } if(hitted) { GetComponent<NetworkView>().RPC("UpdateMyCurrentHealthEverywhere", RPCMode.Others, myHealth); hitted = false; } if (myHealth > 0 && GetComponent<NetworkView>().isMine) { if (myHealth != prevHealth) { GetComponent<NetworkView>().RPC("UpdateMyHealthEverywhere", RPCMode.AllBuffered, myHealth); } } } void ThirstAndHungerController() { if(myHunger > 0) { myHunger -= hungerTake; } else { bleeding = true; } /* if(myThirst > 0) { myThirst -= thirstTake; } else { bleeding = true; } * */ if(myThirst > 0 && myHunger > 0) { bleeding = false; } } void ReloadAmmo() { InventoryItem item = myInventory.getItemByPosition(myInventory.curItem); if(item.item.getType().Equals("Gun")) { int ammoLeft = 20 - item.status[2]; if(item.status[3] > ammoLeft) { item.status[2] += ammoLeft; item.status[3] -= ammoLeft; } else { item.status[2] += item.status[3]; item.status[3] = 0; } } } public void KickBack() { transform.position = Vector3.Lerp(transform.position, transform.position - (transform.forward - transform.up), 1); } void EquipmentUse() { if( Screen.lockCursor ) { if (Input.GetButton("Fire1") && Time.time > nextUseTime) { InventoryItem item = myInventory.getItemByPosition(myInventory.curItem); if(item.item.getType().Equals("Gun")) { //Check ammo if(item.status[2] < 1) { GetComponent<NetworkView>().RPC("NetworkAnimation", RPCMode.All, 3, "ReloadGun", true, 1f); Invoke("ReloadAmmo", 1f); return; } else { item.status[2]--; } } else if(item.item.getType().Equals("Consumable")) { if(item.item.getDescription().Contains("(Food)")) { if(myHunger < MAX_STATS) myHunger += item.item.getDamage(); } else if (item.item.getDescription().Contains("(Drink)")) { if (myHunger < MAX_STATS) myThirst += item.item.getDamage(); } myInventory.myItems[(int)myInventory.curItem.x, (int)myInventory.curItem.y] = InventoryItem.NULL; myInventory.RemoveFromHotbar(item); selectedItem = InventoryItem.NULL; selectedPos = new Vector2(29, 11); } else if (item.item.getType().Equals("Placeable")) { //myInventory.myItems[(int)myInventory.curItem.x, (int)myInventory.curItem.y] = InventoryItem.NULL; //myInventory.RemoveFromHotbar(item); //selectedItem = InventoryItem.NULL; //selectedPos = new Vector2(29, 11); } else if (item.item.getType().Equals("Bow")) { //Check ammo if (item.status[2] < 1) { Invoke("ReloadAmmo", 1f); return; } else { item.status[2]--; } } nextUseTime = Time.time + item.item.getUseDelay(); string animName = item.item.getUseAnimation(); GetComponent<NetworkView>().RPC("NetworkAnimation", RPCMode.All, 3, animName.Trim(), true, item.item.getAnimationSpeed()); GetComponent<NetworkView>().RPC( "SpawnAttack", RPCMode.All, mySpawnpoint.position, Quaternion.Euler(mySpawnpoint.eulerAngles.x + 90, mySpawnpoint.eulerAngles.y, 0), transform.name, item.item.ID); } if(Input.GetButtonDown("Reload")) { InventoryItem item = myInventory.getItemByPosition(myInventory.curItem); if (item.item.getType().Equals("Gun")) { GetComponent<NetworkView>().RPC("NetworkAnimation", RPCMode.All, 3, "ReloadGun", true, 1f); Invoke("ReloadAmmo", 1f); } } if (Input.GetButton("Fire2")) { myCamera.GetComponent<Camera>().fieldOfView = Mathf.Lerp(myCamera.GetComponent<Camera>().fieldOfView, 40f, 2f * Time.deltaTime); } else { myCamera.GetComponent<Camera>().fieldOfView = Mathf.Lerp(myCamera.GetComponent<Camera>().fieldOfView, 60f, 2f * Time.deltaTime); } } } public void DeletePlaceable() { InventoryItem item = myInventory.getItemByPosition(myInventory.curItem); myInventory.myItems[(int)myInventory.curItem.x, (int)myInventory.curItem.y] = InventoryItem.NULL; myInventory.RemoveFromHotbar(item); selectedItem = InventoryItem.NULL; selectedPos = new Vector2(29, 11); } void EquipmentController() { InventoryItem curItem = myInventory.getItemByPosition(myInventory.curItem); int goID; if(curItem.Equals(InventoryItem.NULL)) { goID = 0; } else { goID = myInventory.getItemByPosition(myInventory.curItem).item.ID; } if (myItems[goID] != null) { EnableDisableItems(-1, false); EnableDisableItems(goID, true); } else { EnableDisableItems(-1, false); myInventory.curItem = new Vector2(0,0); } if(GetComponent<NetworkView>().isMine) { if (Input.GetMouseButtonDown(1) && !selectedItem.Equals(InventoryItem.NULL)) { selectedItem = InventoryItem.NULL; } if (Input.GetKeyDown(KeyCode.Alpha1)) { myInventory.curItem = myInventory.myHotbar[0]; GetComponent<NetworkView>().RPC("NetworkAnimation", RPCMode.All, 3, "SwitchItem", true, 1.0f); } if (Input.GetKeyDown(KeyCode.Alpha2)) { myInventory.curItem = myInventory.myHotbar[1]; GetComponent<NetworkView>().RPC("NetworkAnimation", RPCMode.All, 3, "SwitchItem", true, 1.0f); } if (Input.GetKeyDown(KeyCode.Alpha3)) { myInventory.curItem = myInventory.myHotbar[2]; GetComponent<NetworkView>().RPC("NetworkAnimation", RPCMode.All, 3, "SwitchItem", true, 1.0f); } if (Input.GetKeyDown(KeyCode.Alpha4)) { myInventory.curItem = myInventory.myHotbar[3]; GetComponent<NetworkView>().RPC("NetworkAnimation", RPCMode.All, 3, "SwitchItem", true, 1.0f); } if (Input.GetKeyDown(KeyCode.Alpha5)) { myInventory.curItem = myInventory.myHotbar[4]; GetComponent<NetworkView>().RPC("NetworkAnimation", RPCMode.All, 3, "SwitchItem", true, 1.0f); } if(Input.GetButtonDown("Friendly")) { GetComponent<NetworkView>().RPC("NetworkAnimation", RPCMode.All, 3, "Friendly", true, 1.0f); } if(Input.GetButtonDown("Inventory")) { isInventoryOpen = !isInventoryOpen; multiplayer.EnableDisablePlayer(!isInventoryOpen); if (isInventoryOpen) multiplayer.gameState = Multiplayer.GameState.INVENTORY; else multiplayer.gameState = Multiplayer.GameState.PLAYING; } GetComponent<NetworkView>().RPC("SendCurrentItem", RPCMode.Others, (int)myInventory.curItem.x, (int)myInventory.curItem.y); } } void EnableDisableItems(int index, bool enable) { if(index == -1) { for (int i = 0; i < myItems.Count; i++) { myItems[i].gameObject.SetActive(enable); } } else { myItems[index].gameObject.SetActive(enable); } } int GetItemIndex(string GameObjectName) { for (int i = 0; i < myItems.Count; i++) { if (myItems[i].gameObject.name.Equals(GameObjectName)) return i; } return -1; } void OnGUI() { if(GetComponent<NetworkView>().isMine) { mousePos = new Vector2 (Input.mousePosition.x, -Input.mousePosition.y + Screen.height); GUI.skin = skin; if(multiplayer.gameState.Equals(Multiplayer.GameState.PLAYING) || multiplayer.gameState.Equals(Multiplayer.GameState.INVENTORY)) { //Draw Crosshair GUI.DrawTexture(new Rect(Screen.width / 2 - CrossHairs[0].width / 2, Screen.height / 2 - CrossHairs[0].height / 2, CrossHairs[0].width, CrossHairs[0].height), CrossHairs[0]); //Draw Hotbar and Inventory GUIController(); } if (Input.GetButton("Recipes")) { GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), recipes, ScaleMode.StretchToFill); } } } void GUIController() { if(isInventoryOpen) { //Draw Background GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), texture_background, ScaleMode.StretchToFill); //Draw Crafting float craft_w = texture_crafting.width * screenSizeMultiplier; float craft_h = texture_crafting.height * screenSizeMultiplier; Rect craftRect = new Rect(Screen.width / 2 - craft_w / 2, 0, craft_w, craft_h); GUI.DrawTexture(craftRect, texture_crafting); int btnsToShow = 1; for (int i = 0; i < myInventory.craftList.Count; i++) { if(!myInventory.craftList[i].Equals(InventoryItem.NULL)) { btnsToShow++; } } if(GUI.Button(new Rect(Screen.width - 100, 10, 100, 50), "Clear")) { myInventory.ClearCraftList(); } if (btnsToShow > 4) { btnsToShow = 4; } if(btnsToShow > 1) { //Lets see the recipe so far InventoryItem itemToCraft = db.getItemForRecipe(myInventory.craftList); if(!itemToCraft.Equals(InventoryItem.NULL)) { Vector2 startPos = new Vector2(craftRect.x + 12f * screenSizeMultiplier, craftRect.y + 60f * screenSizeMultiplier); Vector2 btnPos = startPos + new Vector2(btnSize.x * screenSizeMultiplier * 5 + (12f * screenSizeMultiplier * 5), 0); Texture2D image = (Texture2D)Resources.Load("Textures/Items/" + itemToCraft.item.ID); if (GUI.Button(new Rect(btnPos.x, btnPos.y, (btnSize.x) * screenSizeMultiplier, (btnSize.y - 10f) * screenSizeMultiplier), image)) { RemoveItemNetwork(db.getRecipeToRemove(itemToCraft, myInventory.craftList)); //Take the used resources myInventory.ClearCraftList(); //Clear craft list if(AddItemNetwork(itemToCraft)) { Debug.Log("Added Item"); } itemToCraft = InventoryItem.NULL; } } } for (int i = 0; i < btnsToShow; i++) { Vector2 startPos = new Vector2(craftRect.x + 12f * screenSizeMultiplier, craftRect.y + 60f * screenSizeMultiplier); Vector2 btnPos = startPos + new Vector2(btnSize.x * screenSizeMultiplier * i + (12f * screenSizeMultiplier * i), 0); if(myInventory.craftList[i].Equals(InventoryItem.NULL)) { if (GUI.Button(new Rect(btnPos.x, btnPos.y, (btnSize.x) * screenSizeMultiplier, (btnSize.y - 10f) * screenSizeMultiplier), "")) { if (!selectedItem.Equals(InventoryItem.NULL)) { myInventory.craftList[i] = selectedItem ; selectedItem = InventoryItem.NULL; selectedPos = new Vector2(29, 11); } } } else { Texture2D image = (Texture2D)Resources.Load("Textures/Items/" + myInventory.craftList[i].item.ID); GUI.DrawTexture(new Rect(btnPos.x, btnPos.y, (btnSize.x) * screenSizeMultiplier, (btnSize.y - 10f) * screenSizeMultiplier), image); } } //Draw Inventory float inv_w = texture_inventory.width * screenSizeMultiplier; float inv_h = texture_inventory.height * screenSizeMultiplier; Rect windowRect = new Rect(Screen.width / 2 - inv_w / 2, Screen.height / 2 - inv_h / 2, inv_w, inv_h); GUI.DrawTexture(windowRect, texture_inventory); //Drop Item if(!selectedItem.Equals(InventoryItem.NULL) && !selectedItem.item.getType().Equals("Placeable")) { if(GUI.Button(new Rect(10, 10, 100, 50), "Drop")) { if(selectedItem.status[0] > 1) //If stackable { selectedItem.status[0]--; } else { myInventory.myItems[(int)selectedPos.x, (int)selectedPos.y] = InventoryItem.NULL; myInventory.RemoveFromHotbar(selectedItem); } Network.Instantiate((Object)Resources.Load("Prefabs/Drop/" + selectedItem.item.Name), myTransform.position, Quaternion.identity, 2); selectedItem = InventoryItem.NULL; selectedPos = new Vector2(29, 11); } } //Draw Inventory Items for (int y = 0; y < myInventory.myItems.GetLength(1); y++) { for (int x = 0; x < myInventory.myItems.GetLength(0); x++) { Vector2 startPos = new Vector2(windowRect.x + 12f * screenSizeMultiplier, windowRect.y + 75f * screenSizeMultiplier); Vector2 pos = new Vector2(x, y); Vector2 btnPos = startPos + new Vector2(btnSize.x * screenSizeMultiplier * x + (12f * screenSizeMultiplier * x), btnSize.y * screenSizeMultiplier * y + (12f * screenSizeMultiplier * y)); if(myInventory.unlocked[x,y]) { if(myInventory.myItems[x,y].Equals(InventoryItem.NULL)) { //Trocar com o fists if (GUI.Button(new Rect(btnPos.x, btnPos.y, btnSize.x * screenSizeMultiplier, btnSize.y * screenSizeMultiplier), "")) { if(!selectedItem.Equals(InventoryItem.NULL)) { if (!selectedPos.Equals(new Vector2(29, 11))) myInventory.UpdateHotbar(selectedPos, new Vector2(x,y)); myInventory.myItems[x, y] = selectedItem; selectedItem = InventoryItem.NULL; if(!selectedPos.Equals(new Vector2(29, 11))) myInventory.myItems[(int)selectedPos.x, (int)selectedPos.y] = InventoryItem.NULL; selectedPos = new Vector2(29, 11); } } } else { InventoryItem item = myInventory.myItems[x, y]; image = (Texture2D)Resources.Load("Textures/Items/" + item.item.ID); if(!selectedItem.Equals(InventoryItem.NULL)) { //We have a selected item, and we want to replace with other item. if (GUI.Button(new Rect(btnPos.x, btnPos.y, btnSize.x * screenSizeMultiplier, btnSize.y * screenSizeMultiplier), image)) { myInventory.myItems[(int)selectedPos.x, (int)selectedPos.y] = item; myInventory.myItems[x, y] = selectedItem; selectedItem = InventoryItem.NULL; selectedPos = new Vector2(29, 11); } if (item.status[1] != 0) //If its stackable { GUI.Label(new Rect(btnPos.x + (btnSize.x * screenSizeMultiplier / 2), btnPos.y + btnSize.y * screenSizeMultiplier - 20, 30, 20), "x" + item.status[0].ToString()); } } else { //We want to choose an item if (GUI.Button(new Rect(btnPos.x, btnPos.y, btnSize.x * screenSizeMultiplier, btnSize.y * screenSizeMultiplier), image)) { selectedItem = item; selectedPos = new Vector2(x, y); } if (item.status[1] != 0) //If its stackable { GUI.Label(new Rect(btnPos.x + (btnSize.x * screenSizeMultiplier / 2), btnPos.y + btnSize.y * screenSizeMultiplier - 20, 30, 20), "x" + item.status[0].ToString()); } } } } } } //Draw Hotbar with buttons float hotbar_w = texture_hotbar.width * screenSizeMultiplier; float hotbar_h = texture_hotbar.height * screenSizeMultiplier; GUI.DrawTexture(new Rect( Screen.width / 2 - hotbar_w / 2, Screen.height - hotbar_h, hotbar_w, hotbar_h), texture_hotbar); for(int i = 0; i < myInventory.myHotbar.Length; i++) { Vector2 hotbarItem = myInventory.myHotbar[i]; float img_w = 87 * screenSizeMultiplier; float img_h = 87 * screenSizeMultiplier; float base_x = Screen.width / 2 - hotbar_w / 2 + (12 * screenSizeMultiplier) + (img_w * i) + (12 * screenSizeMultiplier * i); float base_y = Screen.height - hotbar_h + 12; InventoryItem item = myInventory.getItemByPosition(myInventory.myHotbar[i]); Texture2D image = (Texture2D)Resources.Load("Textures/Items/" + item.item.ID); if(!hotbarItem.Equals(new Vector2(29, 11))) { if(item.item.ID != 0) { if (GUI.Button(new Rect(base_x, base_y, img_w, img_h), image)) { if(!selectedItem.Equals(InventoryItem.NULL)) { myInventory.myHotbar[i] = myInventory.getItemPosition(item.item); selectedItem = InventoryItem.NULL; selectedPos = new Vector2(29, 11); } else { if(Event.current.button == 1) { myInventory.myHotbar[i] = new Vector2(29, 11); } } } } } else { if (GUI.Button(new Rect(base_x, base_y, img_w, img_h), image)) { if(!selectedItem.Equals(InventoryItem.NULL)) { myInventory.myHotbar[i] = myInventory.getItemPosition(selectedItem.item); selectedItem = InventoryItem.NULL; selectedPos = new Vector2(29, 11); } } } } if(!selectedItem.Equals(InventoryItem.NULL)) { Texture2D image = (Texture2D)Resources.Load("Textures/Items/" + selectedItem.item.ID); GUI.Box(new Rect(mousePos.x, mousePos.y, btnSize.x, btnSize.y), image); } //Debug /* for (int y = 0; y < myInventory.myItems.GetLength(1); y++) { for (int x = 0; x < myInventory.myItems.GetLength(0); x++) { GUI.Label(new Rect(0 + x * 100, 0 + y * 20, 100, 20), myInventory.myItems[x, y].item.Name); } } for(int i = 0; i < myInventory.myHotbar.Length; i++) { GUI.Label(new Rect(0 + i * 100, 150, 100, 20), myInventory.myHotbar[i].ToString()); } GUI.Label(new Rect(0, 170, 500, 20), selectedItem.item.Name + " " + selectedPos.ToString()); * */ } else { //Draw Hotbar float hotbar_w = texture_hotbar.width * screenSizeMultiplier; float hotbar_h = texture_hotbar.height * screenSizeMultiplier; GUI.DrawTexture(new Rect( Screen.width / 2 - hotbar_w / 2, Screen.height - hotbar_h, hotbar_w, hotbar_h), texture_hotbar); //Draw Hotbar Items for (int i = 0; i < myInventory.myHotbar.Length; i++) { float img_w = 87 * screenSizeMultiplier; float img_h = 87 * screenSizeMultiplier; float base_x = Screen.width / 2 - hotbar_w / 2 + (12 * screenSizeMultiplier) + (img_w * i) + (12 * screenSizeMultiplier * i); float base_y = Screen.height - hotbar_h + 12; InventoryItem item = myInventory.getItemByPosition(myInventory.myHotbar[i]); //Item in the hotbar Texture2D image = (Texture2D)Resources.Load("Textures/Items/" + item.item.ID); GUI.DrawTexture(new Rect(base_x, base_y, img_w, img_h), image); } } } void AnimationController() { //Walk Animation if(myCharMotor.movement.velocity.magnitude >= 2) { if(!myHips.GetComponent<Animation>().isPlaying) { GetComponent<NetworkView>().RPC("NetworkAnimation", RPCMode.All, 2, "Walk", true, 1.0f); } } //Weapons if(!mySpine.GetComponent<Animation>().isPlaying) { if (myInventory.getItemByPosition(myInventory.curItem).Equals(InventoryItem.NULL)) { GetComponent<NetworkView>().RPC("NetworkAnimation", RPCMode.All, 3, "IdleFists", true, 1.0f); } else { if (myInventory.getItemByPosition(myInventory.curItem).item.Type.Equals("MeleeDual")) //Dual Wield { GetComponent<NetworkView>().RPC("NetworkAnimation", RPCMode.All, 3, "IdleDualHands", true, 1.0f); } else if (myInventory.getItemByPosition(myInventory.curItem).item.Type.Equals("MeleeSpear")) //Spear Wield { GetComponent<NetworkView>().RPC("NetworkAnimation", RPCMode.All, 3, "SpearIdle", true, 1.0f); } else if (myInventory.getItemByPosition(myInventory.curItem).item.Type.Equals("MeleeOne")) //One hand weapon { GetComponent<NetworkView>().RPC("NetworkAnimation", RPCMode.All, 3, "OneHandIdle", true, 1.0f); } else if (myInventory.getItemByPosition(myInventory.curItem).item.Type.Equals("Item")) //Item Idle { GetComponent<NetworkView>().RPC("NetworkAnimation", RPCMode.All, 3, "IdleDualHands", true, 1.0f); } else if (myInventory.getItemByPosition(myInventory.curItem).item.Type.Equals("Gun")) //Gun Idle { GetComponent<NetworkView>().RPC("NetworkAnimation", RPCMode.All, 3, "IdleGunDualHands", true, 1.0f); } else if (myInventory.getItemByPosition(myInventory.curItem).item.Type.Equals("Bow")) //Bow Idle { GetComponent<NetworkView>().RPC("NetworkAnimation", RPCMode.All, 3, "IdleDualHands", true, 1.0f); } else if (myInventory.getItemByPosition(myInventory.curItem).item.Type.Equals("Consumable")) //Bow Idle { GetComponent<NetworkView>().RPC("NetworkAnimation", RPCMode.All, 3, "IdleDualHands", true, 1.0f); } else if (myInventory.getItemByPosition(myInventory.curItem).item.Type.Equals("Placeable")) //Bow Idle { GetComponent<NetworkView>().RPC("NetworkAnimation", RPCMode.All, 3, "IdleDualHands", true, 1.0f); } else { GetComponent<NetworkView>().RPC("NetworkAnimation", RPCMode.All, 3, "IdleFists", true, 1.0f); } } } } void SpawnSound(Vector3 pos, string clipName) { GameObject go = (GameObject)Resources.Load("Prefabs/General/AudioSpawner"); go = Instantiate(go, pos, Quaternion.identity) as GameObject; go.GetComponent<AudioSource>().PlayOneShot((AudioClip)Resources.Load("Sounds/" + clipName)); } IEnumerator InstantiateAttack(Vector3 pos, Quaternion rot, string owner, int itemID, float delay) { yield return new WaitForSeconds(delay); SpawnSound(transform.position, db.Items[itemID].getAudioName()); if (!pos.Equals(mySpawnpoint.position)) { pos = mySpawnpoint.position; } if(!rot.Equals(Quaternion.Euler(mySpawnpoint.eulerAngles.x + 90, mySpawnpoint.eulerAngles.y, 0))) { rot = Quaternion.Euler(mySpawnpoint.eulerAngles.x + 90, mySpawnpoint.eulerAngles.y, 0); } GameObject go = Instantiate(AttackPrefabs[db.Items[itemID].getPrefabAttack()], pos, rot) as GameObject; MeleeAttack m = go.GetComponent<MeleeAttack>(); if(m != null) { m.owner = owner; m.weaponID = itemID; } else { go.GetComponent<Arrow>().owner = owner; go.GetComponent<Arrow>().weaponID = itemID; go.GetComponent<Rigidbody>().AddForce(mySpawnpoint.forward * arrowForce); } } public bool AddItemNetwork(InventoryItem item) { Vector2 slot = myInventory.getNextAvailableSlot(); if(myInventory.AddItem(item)) { GetComponent<NetworkView>().RPC("AddItemOverNetwork", RPCMode.OthersBuffered, item.item.ID, (int)slot.x, (int)slot.y); return true; } else { return false; } } public bool RemoveItemNetwork(InventoryItem item, int qtd) { Vector2 slot = myInventory.getItemPosition(item.item); if (myInventory.RemoveItem(item, qtd)) { GetComponent<NetworkView>().RPC("RemoveItemOverNetwork", RPCMode.OthersBuffered, item.item.ID, qtd); return true; } else { return false; } } public bool RemoveItemNetwork(List<InventoryItem> item) { for(int x = 0; x < item.Count; x++) { Vector2 slot = myInventory.getItemPosition(item[x].item); if (myInventory.RemoveItem(item[x], item[x].status[0])) { GetComponent<NetworkView>().RPC("RemoveItemOverNetwork", RPCMode.OthersBuffered, item[x].item.ID, item[x].status[0]); } } return true; } /* * RPC's */ [RPC] void SpawnAttack(Vector3 pos, Quaternion rot, string owner, int itemID) { StartCoroutine( InstantiateAttack( pos, rot, owner, itemID, db.Items[itemID].getAttackSpawnDelay() )); } [RPC] void NetworkAnimation(int trans, string anim, bool cf, float AnimSpeed) { if(myArray[trans] != null) myArray[trans].GetComponent<Animation>()[anim].speed = AnimSpeed; if (cf) //Crossfade? { myArray[trans].GetComponent<Animation>().CrossFade(anim); } else { myArray[trans].GetComponent<Animation>().Play(anim); } } [RPC] void SendCurrentItem(int x, int y) { myInventory.curItem = new Vector2(x, y); } [RPC] void DestroySelf() { Destroy(gameObject); } [RPC] void UpdateMyHealthEverywhere( float hp) { prevHealth = hp; } [RPC] void UpdateMyCurrentHealthEverywhere(float hP) { myHealth = hP; } [RPC] public void AddItemOverNetwork(int itemID, int x, int y) { multiplayer.GetComponent<Console>().Write("AddItemOverNetwork Called in player " + gameObject.name); Item i = GameObject.Find("MPManager").GetComponent<ItemDatabase>().getItemByID(itemID); myInventory.myItems[x, y] = new InventoryItem(i, InventoryItem.DefaultStatus(false, 0, 1)); multiplayer.GetComponent<Console>().Write("Item " + i.ToString() + " added to " + new Vector2(x,y).ToString() + " on player " + gameObject.name); } [RPC] public void RemoveItemOverNetwork(int itemID, int qtd) { multiplayer.GetComponent<Console>().Write("RemoveItemOverNetwork Called in player " + gameObject.name); Item i = GameObject.Find("MPManager").GetComponent<ItemDatabase>().getItemByID(itemID); InventoryItem itemToDelete = new InventoryItem(i, InventoryItem.DefaultStatus(false, 1, 1)); if (myInventory.RemoveItem(itemToDelete, qtd)) { multiplayer.GetComponent<Console>().Write("Item " + i.ToString() + " removed on player " + gameObject.name); } else { multiplayer.GetComponent<Console>().Error("Item couldn't be removed!"); } } } public class Inventory { public Vector2 curItem; public InventoryItem[,] myItems; public bool[,] unlocked; public Vector2[] myHotbar; public int maxItems; public List<InventoryItem> craftList; public Inventory() { curItem = new Vector2(29, 11); myItems = new InventoryItem[6, 5]; unlocked = new bool[6, 5]; craftList = new List<InventoryItem>(); myHotbar = new Vector2[5]; maxItems = 10; ItemDatabase db = GameObject.Find("MPManager").GetComponent<ItemDatabase>(); setupArray(); OpenSlots(12); AddItem(new InventoryItem(db.getItemByName("WoodAxe"), InventoryItem.DefaultStatus(false, 0, 1))); } public void UpdateHotbar(Vector2 old, Vector2 newpos) { for (int i = 0; i < myHotbar.Length; i++) { if (myHotbar[i].Equals(old)) myHotbar[i] = newpos; } } public void ClearCraftList() { for (int i = 0; i < craftList.Count; i++) { craftList[i] = InventoryItem.NULL; } } public void setupArray() { for (int i = 0; i < myHotbar.Length; i++) { myHotbar[i] = new Vector2(29, 11); } for (int y = 0; y < myItems.GetLength(1); y++) { for (int x = 0; x < myItems.GetLength(0); x++) { myItems[x, y] = InventoryItem.NULL; } } for (int i = 0; i < 4; i++) { craftList.Add(InventoryItem.NULL); } } public InventoryItem getItemByPosition(Vector2 pos) { if (isValid(pos)) { if (!myItems[(int)pos.x, (int)pos.y].Equals(InventoryItem.NULL)) { return myItems[(int)pos.x, (int)pos.y]; } else { return InventoryItem.NULL; } } return InventoryItem.NULL; } public Vector2 getItemPosition(Item item) { for (int y = 0; y < myItems.GetLength(1); y++) { for (int x = 0; x < myItems.GetLength(0); x++) { if (myItems[x, y] != null) { if (myItems[x, y].item.Equals(item)) { return new Vector2(x, y); } } } } return new Vector2(29, 11); } public Vector2 getNextAvailableSlot() { for (int y = 0; y < unlocked.GetLength(1); y++) { for (int x = 0; x < unlocked.GetLength(0); x++) { if (myItems[x, y].Equals(InventoryItem.NULL) && unlocked[x, y]) { return new Vector2(x, y); } } } return new Vector2(29, 11); } public Vector2 getNextSlot() { for (int y = 0; y < myItems.GetLength(1); y++) { for (int x = 0; x < myItems.GetLength(0); x++) { if (unlocked[x, y] == false) { return new Vector2(x, y); } } } return new Vector2(29, 11); } public static bool isValid(Vector2 validate) { return !validate.Equals(new Vector2(29, 11)); } public bool AddItem(InventoryItem newItem, Vector2 slot) { if (isValid(slot)) { if (newItem.status[1] != 0) //Item is stackable { if (isValid(getItemPosition(newItem.item)) && getItemByPosition(getItemPosition(newItem.item)).status[0] < 10) //Already exists, lets add to the stack. { int pos_x = (int)getItemPosition(newItem.item).x; int pos_y = (int)getItemPosition(newItem.item).y; myItems[pos_x, pos_y].status[0]++; //Increase the amount of the item return true; //Success on adding the item. } else //Item doesn't exist yet { myItems[(int)slot.x, (int)slot.y] = newItem; return true; } } else { //Item is not stackable, so add it to a new position myItems[(int)slot.x, (int)slot.y] = newItem; return true; } } return false; } public void OpenSlots(int amount) { Vector2 start = getNextSlot(); int done = 0; for (int y = (int)start.y; y < myItems.GetLength(1); y++) { for (int x = (int)start.x; x < myItems.GetLength(0); x++) { if (done < amount) { unlocked[x, y] = true; done++; } } } } public bool AddItem(InventoryItem item) { Vector2 position = getNextAvailableSlot(); if (isValid(position)) { if (AddItem(item, position)) { return true; } else { return false; } } return false; } public bool RemoveItem(InventoryItem item, int qtd) { Vector2 position = getItemPosition(item.item); if(isValid(position)) { InventoryItem i = myItems[(int)position.x, (int)position.y]; int itemQtd = i.status[0]; if(itemQtd - qtd < 1) { //Remover o item todo myItems[(int)position.x, (int)position.y] = InventoryItem.NULL; } else { i.status[0] -= qtd; } return true; } else { return false; } } public bool RemoveItem(List<InventoryItem> item) { for(int x = 0; x < item.Count; x++) { Vector2 position = getItemPosition(item[x].item); if (isValid(position)) { InventoryItem i = myItems[(int)position.x, (int)position.y]; int itemQtd = i.status[0]; if (itemQtd - item[x].status[0] < 1) { //Remover o item todo myItems[(int)position.x, (int)position.y] = InventoryItem.NULL; } else { i.status[0] -= item[x].status[0]; } } } return true; } public void RemoveFromHotbar(InventoryItem item) { Vector2 posToRemove = getItemPosition(item.item); for (int i = 0; i < myHotbar.Length; i++) { if (myHotbar[i].Equals(posToRemove)) { myHotbar[i] = new Vector2(29, 11); } } } } public class InventoryItem { public Item item; public List<int> status; public InventoryItem(Item i, List<int> s) { this.item = i; this.status = s; } public static List<int> DefaultStatus(bool stackable, int stackAmmount, int quantity) { //Status Configuration: //Quantity | Stackable | Ammo | Extra Ammo List<int> s = new List<int>(); if(stackable) { s.Add(quantity); //First is quantity s.Add(stackAmmount); //Second is stackable size } else { s.Add(quantity); //First Quantity s.Add(0); } s.Add(20); s.Add(40); return s; } public override string ToString() { if (item == null) return "Inv item with null item"; else return "InvItem | " + item.ToString(); } public static InventoryItem NULL = new InventoryItem(GameObject.Find("MPManager").GetComponent<ItemDatabase>().getItemByName("Fists"), null); }
  13. Hi guys, I've been using the free FPS Kit (http://armedunity.com/files/file/174-au-fps-kit-unity-5/) and i'm really confused about changing the hands, i just want to change the hands in the Kit and whenever i did everything works fine except the animation of hand (like reloading animation) can someone help me in changing the hands of this kit without having any animation issue ! Thanks
  14. Hey guys, I've been working on my new zombie game and i'm using Premium FPS kit 0.95, it's really a fabulous kit I've ever seen, with all features, for now i'm facing some really crazy problems in changing model of character and arms, please can someone help me with it I shall be very thankful to him :/ whenever i try to change it every time I get an error in return nothing changes, all working is done on GameObjects by the creator of that kit (ArmedUnity) and I've prefabs of models and arms I don't know how to change it, please guys help me, I'm really messed up
  15. Hey everyone, iv'e been looking for this type of answer for a long time, but i never got it, i don't know if i'm going to get it here either but i'll try Okey, so my question is, can anyone however make a long series on youtube on Multiplayer Tutorials for Unity3D? in C# please I have some things i wan't to cover up Guns: -A list of guns with it's own fire rate, sight position, and so on -Somewhere where you can customize your weapon -Then save the gun with the attachments -Different categories with guns and melees Others -Sniper rifle sight like in Call Of Duty -Host server (choose map, max players, gamemode, server password, server name) -Different gamemodes like Team Deathmatch, Free For All, Demolition, Domination and so on -Game money, get 100 points for each kill. -Save game money, buy guns with game money -In-game store, where you can buy money -Run server untill host puts it down, not if he turns of he's computer, but when he clicks on Pause Server or Stop Server -Custom server plugins. -Chat -Leaderboards -Killfeed -Login/Register with a Mysql database -save all player prefs to players account, then to the dataabse -save player cash to database, and altså receive cash from the database -Grenades, flashbangs and bomb planting -claymore -bazooka auto lock -sell items/weapons and receive game cash -level up , save level to database, and receive level from the database -When you come into e certain level, then a weapon will get unlocked, then you can BUY the weapon, not get it for free. -Firend list, Join Friends game, delete friend, give friends cash, search for players and add. -kill streaks. -create a squad/team/crew -Invite, accept and kick players out from your team if your the leader. Yeah, there are some more things, but i think this is it for now ?
  16. Hello, I have got a problem. In my car game I want to add moving speedometers, but there is the problem. My camera sees that speedometer needle overlaps with the display behind it. But it is not so. - http://imgur.com/5a2BQU1 : Cameras view. - http://imgur.com/dCy3dAM : In editor (As you can see, there is a gap between them). - https://youtu.be/VtLBNEXa4LU?list=PL5f0H3dHKn9eTeaMcYLZZju_vgvFThHsR : My car game videos. Thanks for help.
  17. I need arms for my FPS, and i just cannot found some. Does someone know where I can found arms?
  18. 1.using UnityEngine; 2.using System.Collections; 3. 4.public class BirdControl : MonoBehaviour { 5. 6. 7.public Vector2 JumpForce = new Vector2 (0,500); 8. Use this for initialization 9.void Start () { 10. 11.} 12. 13. Update is called once per frame 14.void Update () { 15. 16. if (Input.GetKeyDown (KeyCode.Space)) { 17. GetComponent<Rigidbody2D>().AddForce (JumpForce); Unity error:Assets/Scripts/BirdControl.cs(20,1): error CS8025: Parsing error Can someone help me plz..
  19. Hi guys, fisrt of all, i have to say that i am learning C# so please dont be mean D: I was searching for a C# script to show an image while you are on a trigger. I have searched, but i only find JS tutorials. Please help
  20. public void makeProduct(string message) { makeButton.gameObject.SetActive (true); makePanel.SetActive (true); make2button.gameObject.SetActive(true); totalDev.gameObject.SetActive(true); totalDev.GetComponent<Text>().text = "Total Development Cost: $" + totalMake.ToString(); GetComponent<timeScript>().StopTimer(); } public void stopProduct() { print (gameName); if (pickedsystem == "Develop for:") { } else { makeButton.gameObject.SetActive(false); makePanel.SetActive(false); } GetComponent<timeScript>().StartTimer(); } I tried to make it in my gameDictionaries script that time would freeze, then having it resume when stopProduct is started. Then I had the following in my timeScript script(note, a lot of info here is useless as it is used for other parts): void Start() { InvokeRepeating("Timer", 0, 1); } public void Timer() { timeText.GetComponent<Text>().text = "W" + week.ToString() + "" + year.ToString() + " Day " + day.ToString(); playerCash.GetComponent<Text>().text = "$" + myCash.ToString(); #region YEAR //Check if month equals 13 (allows for 12th month to be counted) if (month == 13) { year++; month = 0; } #endregion #region MONTH //Check if week equals 5 (allows for 5th week to be counted) if (month == 5) { month++; week = 0; } #endregion #region WEEK //Check if day equals 8 (allows for 7th day to be counted) if (day == 8) { week++; day = 0; } #endregion #region DAY //Check if Time equals 5 (allows for 4 seconds) if (time == 1) { day++; time = 0; } else { time++; } #endregion if (week == 2 && month == 0 && year == 1980) { alert.PopUp("Welcome to iDeveloper! This is a pre-playable build that is not intended for consumer use"); } else if (week == 4 && month == 0 && year == 1980) { alert.PopUp("To create a game, go to Make Game"); } else if (week == 1 && month == 1 && year == 1981) { alert.PopUp("Create a game so you can earn money and grow your company!"); print("FES Coming in 4 years"); } print(week); print(month); print(year); } public void StartTimer() { InvokeRepeating("TimerFunction", 0, 1); Time.timeScale = 1f; } public void StopTimer() { CancelInvoke("Timer"); Time.timeScale = 0; } } The issue is, time isn't resuming when StartTimer is called. What could I do to get time to resume?
  21. Hello Everyone! My name is Kevin and I need a team to help me create a Civilization game for IOS. Before you wright it; yes I have heard of Civ Revolution... Before Creating this game I have been a game developer for almost 4 years and I am looking for a team to help me create my dream. The game will be a simple version of Civilization, but at the same time not so simple people will call it:"Made for Noobs", or something like that. THE GAME: The game will work like Civ, but will be simpler. There will be a Story mode in the way of Total War: Napoleon. Small parts of the world to make you learn, and at last the whole world. You will be able to play with friends, Online, Single Player and a offline COOP for IPAD. (We will work on the Singe Player first, then COOP, and at last ONLINE). You will play as Historic figures like in other games, but to make sure there will not be lag, there is not going to be any Random Worlds. The Singleplayer will follow Historical event, while the COOP and online can be based on Historical events, or just be random. ME: Name: Kevin ----- Contact Info: Skype: ook_nkoo, EMAIL: oOKNKOo@yahoo.com Age: 15 Good at: Design, project leading, World Design, Some Coding Location: Denmark PEOPLE I NEED Texturer: (A Person able to make the textures for the models) 0/1 Map Designer: (Able to recreate the world on the style of the game) 0/1 Music/Sound Designer: (Able to create the sound and iconic music of the game) 0/1 Programmers: (Codes will of course be needed so if you can code please help) 0/? (Not sure how many is needed) Modellers: (You need to be able to create a model, but not something amazing just something simple to stay in style) 0/1 If you want to join please write a comment, add me on skype, or write me a mail UPDATES:
  22. i Want to Know Best Way to handle different types of gloves/Hands because i would like to have different types of gloves/hands in my fps. I was think of just changing the mesh but i wanted to know if there is another way?
  23. Hi guys. I need some help with the "FPSKitV1.2" It wont let me pick up weapons , and hit/shot things. Im not the best at english but im Danish so i understand but i dont know some words
  24. Hey guys my names "Monsta" and im going to be making an Online Multiplayer iOS game for devices such as the iPhone and iPad. This game will be an open world zombie survival game, throughout the game you will have to find Food, Armor, and Weapons to survive. Players will be able to find other players and there will be cars for transportation. I want to create this game because I personally think it will be huge. There are no other 2D Zombie Multiplayer Open world games in the App store right now so I want to be the first to make it happen. I am looking for people that can work for free.(No-Pay) This is what ill be looking for: - Programmer - Audio Design (Music) - Audio Design(Effects) - 2D Design/GFX Design If you would like to help and you know how to do one of those in the list above you can add me on Skype or send me a PM. Skype: EsoMyEgo -------------------------------------------------------------------------------------------------------------------------------------------------------------
  25. Hey guys ! I started using OMA's fps kit a while ago, and I was messing around with it until I stummbeled upon some errors : Assets/Resources/NewScripts/WeaponManager.js(130,70): BCE0004: Ambiguous reference 'fireMode': fireMode, fireMode. Assets/Resources/NewScripts/WeaponManager.js(134,69): BCE0004: Ambiguous reference 'Ammo': Ammo, Ammo. Assets/Resources/NewScripts/WeaponManager.js(168,83): BCE0004: Ambiguous reference 'fireMode': fireMode, fireMode. Assets/Resources/NewScripts/WeaponManager.js(185,76): BCE0004: Ambiguous reference 'fireMode': fireMode, fireMode. Is there anyway to fix this ???? (btw im new to the forums so dont blame my bad forum posts) here is the code: /** * Script written by OMA [www.armedunity.com] * Edited by pokeyoshi3 (for multiplayer Capabillities) **/ var weaponsInUse : GameObject[]; // used weapons, among which you can switch. var weaponsInGame : GameObject[]; // all weapons, which could be used in game var worldModels : Rigidbody[]; // just a prefab which could be instantiated when you drop weapon var firstguns : GameObject[]; // these are the startweapons to reset the current weapons on respawn. var hit : RaycastHit; var distance : float = 2.0; var layerMaskWeapon : LayerMask; var layerMaskAmmo : LayerMask; var dropPosition : Transform; var switchWeaponTime : float = 0.5; @HideInInspector var canSwitch : boolean = true; @HideInInspector var showWepGui : boolean = false; @HideInInspector var showAmmoGui : boolean = false; private var equipped : boolean = false; //@HideInInspector //var i : int = 0; //@HideInInspector var weaponToSelect : int; //@HideInInspector var setElement : int; //@HideInInspector var weaponToDrop : int; var mySkin : GUISkin; var pickupSound : AudioClip; private var textFromPickupScript : String = ""; private var notes : String = ""; private var note : String = "Press key <E> to pick up Ammo"; private var note2 : String = "Select appropriate weapon to pick up ammo"; function Start (){ weaponToSelect = 0; DeselectWeapon(); weaponsInUse = firstguns; } function Update () { if (networkView.isMine == true) { if (Input.GetKeyDown("1") && weaponsInUse.length >= 1 && canSwitch && weaponToSelect != 0) { DeselectWeapon(); weaponToSelect = 0; } else if (Input.GetKeyDown("2") && weaponsInUse.length >= 2 && canSwitch && weaponToSelect != 1) { DeselectWeapon(); weaponToSelect = 1; } if (Input.GetAxis("Mouse ScrollWheel") > 0 && canSwitch){ weaponToSelect++; if (weaponToSelect > (weaponsInUse.length - 1)){ weaponToSelect = 0; } DeselectWeapon(); } if (Input.GetAxis("Mouse ScrollWheel") < 0 && canSwitch){ weaponToSelect--; if (weaponToSelect < 0){ weaponToSelect = weaponsInUse.length - 1; } DeselectWeapon(); } var position = transform.parent.position; var direction : Vector3 = transform.TransformDirection (Vector3.forward); if (Physics.Raycast (position, direction, hit, distance, layerMaskWeapon.value)){ var prefab : WeaponIndex = hit.transform.GetComponent("WeaponIndex"); setElement = prefab.setWeapon; showWepGui = true; //if you want more than 2 weapons equip at the same time if(weaponsInUse[0] != weaponsInGame[setElement] && weaponsInUse[1] != weaponsInGame[setElement]){ //&& weaponsInUse[2] != weaponsInGame[setElement] && weaponsInUse[3] != weaponsInGame[setElement]){ equipped = false; }else{ equipped = true; } if(canSwitch){ if(!equipped && Input.GetKeyDown ("e")){ DropWeapon(weaponToDrop); DeselectWeapon(); weaponsInUse[weaponToSelect] = weaponsInGame[setElement]; if(setElement == 8){ var pickupGOW1 : Pickup = hit.transform.GetComponent("Pickup"); addStickGrenades(pickupGOW1.amount); } Destroy(hit.collider.transform.parent.gameObject); }else{ if(setElement == 8){ if(Input.GetKeyDown ("e")){ var pickupGOW : Pickup = hit.transform.GetComponent("Pickup"); addStickGrenades(pickupGOW.amount); Destroy(hit.collider.transform.parent.gameObject); } } } } }else{ showWepGui = false; } if (Physics.Raycast (position, direction, hit, distance, layerMaskAmmo.value)){ showAmmoGui = true; if(hit.transform.CompareTag("Ammo")){ var pickupGO : Pickup = hit.transform.GetComponent("Pickup"); //ammo for pistols, rifles if (pickupGO.pickupType == PickupType.Magazines) { var mags : WeaponScriptNEW = weaponsInUse[weaponToSelect].gameObject.transform.GetComponent("WeaponScriptNEW"); if(mags != null && mags.firstMode != fireMode.launcher){ notes = ""; textFromPickupScript = note; if(Input.GetKeyDown ("e")){ if(mags.ammoMode == Ammo.Magazines){ mags.magazines += pickupGO.amount; }else{ mags.magazines += pickupGO.amount * mags.bulletsPerMag; } audio.clip = pickupSound; audio.Play(); Destroy(hit.collider.gameObject); } }else{ textFromPickupScript = pickupGO.AmmoInfo; notes = note2; } } //ammo for Sniper rifle if (pickupGO.pickupType == PickupType.SniperMagazines) { var magsSniper : SniperScript = weaponsInUse[weaponToSelect].gameObject.transform.GetComponent("SniperScript"); if(magsSniper != null){ notes = ""; textFromPickupScript = note; if(Input.GetKeyDown ("e")){ magsSniper.magazines += pickupGO.amount; audio.clip = pickupSound; audio.Play(); Destroy(hit.collider.gameObject); } }else{ textFromPickupScript = pickupGO.AmmoInfo; notes = note2; } } //ammo for weapon if second fireMode is luancher if (pickupGO.pickupType == PickupType.Projectiles) { var projectile : WeaponScriptNEW = weaponsInUse[weaponToSelect].gameObject.transform.GetComponent("WeaponScriptNEW"); if(projectile != null && projectile.secondMode == fireMode.launcher){ notes = ""; textFromPickupScript = note; if(Input.GetKeyDown ("e")){ projectile.projectiles += pickupGO.amount; audio.clip = pickupSound; audio.Play(); Destroy(hit.collider.gameObject); } }else{ textFromPickupScript = pickupGO.AmmoInfo; notes = note2; } } //ammo for rocket launcher if (pickupGO.pickupType == PickupType.Rockets) { var rockets : WeaponScriptNEW = weaponsInUse[weaponToSelect].gameObject.transform.GetComponent("WeaponScriptNEW"); if(rockets != null && rockets.firstMode == fireMode.launcher){ notes = ""; textFromPickupScript = note; if(Input.GetKeyDown ("e")){ rockets.projectiles += pickupGO.amount; rockets.EnableProjectileRenderer(); audio.clip = pickupSound; audio.Play(); Destroy(hit.collider.gameObject); } }else{ textFromPickupScript = pickupGO.AmmoInfo; notes = note2; } } //ammo for shotgun if (pickupGO.pickupType == PickupType.Shells) { var bullets : ShotGunScriptNEW = weaponsInUse[weaponToSelect].gameObject.transform.GetComponent("ShotGunScriptNEW"); if(bullets != null){ notes = ""; textFromPickupScript = note; if(Input.GetKeyDown ("e")){ bullets.magazines += pickupGO.amount; audio.clip = pickupSound; audio.Play(); Destroy(hit.collider.gameObject); } }else{ textFromPickupScript = pickupGO.AmmoInfo; notes = note2; } } //pickup health if (pickupGO.pickupType == PickupType.Health) { textFromPickupScript = pickupGO.AmmoInfo; notes = ""; if(Input.GetKeyDown ("e")){ var playerGO = GameObject.Find("Player"); var health : PlayerDamageNew = playerGO.gameObject.transform.GetComponent("PlayerDamageNew"); health.hitPoints += pickupGO.amount; audio.clip = pickupSound; audio.Play(); Destroy(hit.collider.gameObject); } } } }else{ showAmmoGui = false; } } else{ enabled = false; } } function addStickGrenades(amount : int){ yield WaitForSeconds(.5); var stickGrenade : GrenadeScript = weaponsInGame[8].gameObject.transform.GetComponent("GrenadeScript"); stickGrenade.grenadeCount += amount; stickGrenade.DrawWeapon(); } function OnGUI(){ GUI.skin = mySkin; var style1 = mySkin.customStyles[0]; if(showWepGui){ if(!equipped){ GUI.Label(Rect(Screen.width - (Screen.width/1.7),Screen.height - (Screen.height/1.4),800,100),"Press key << E >> to pickup weapon", style1); }else{ GUI.Label(Rect(Screen.width - (Screen.width/1.7),Screen.height - (Screen.height/1.4),800,100),"Weapon is already equipped"); } } if(showAmmoGui){ GUI.Label(Rect(Screen.width - (Screen.width/1.7),Screen.height - (Screen.height/1.4),800,200), notes + "\n" + textFromPickupScript, style1); } } function DeselectWeapon(){ //Dectivate all weapon for (var i : int = 0; i < weaponsInUse.length; i++){ weaponsInUse[i].gameObject.SendMessage("Deselect", SendMessageOptions.DontRequireReceiver); var deactivate : Component[] = weaponsInUse[i].gameObject.GetComponentsInChildren(MonoBehaviour); for (var d in deactivate) { var d : MonoBehaviour = d as MonoBehaviour; if (d) d.enabled = false; } weaponsInUse[i].gameObject.SetActiveRecursively(false); } Wait(); } function Wait(){ canSwitch = false; yield WaitForSeconds(switchWeaponTime); SelectWeapon(weaponToSelect); yield WaitForSeconds(switchWeaponTime); canSwitch = true; } function SelectWeapon (i : int) { //Activate selected weapon weaponsInUse[i].gameObject.SetActiveRecursively(true); var activate : Component[] = weaponsInUse[i].gameObject.GetComponentsInChildren(MonoBehaviour); for (var a in activate) { var a : MonoBehaviour = a as MonoBehaviour; if (a) a.enabled = true; } weaponsInUse[i].gameObject.SendMessage("DrawWeapon"); var temp : WeaponIndex = weaponsInUse[i].gameObject.transform.GetComponent("WeaponIndex"); weaponToDrop = temp.setWeapon; } function DropWeapon(index : int){ for (var i : int = 0; i < worldModels.length; i++){ if (i == index){ var drop : Rigidbody = Instantiate(worldModels[i], dropPosition.transform.position, dropPosition.transform.rotation); drop.AddRelativeForce(0,50,Random.Range(100, 200)); } } }