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.

lucian112

Member
  • Content count

    49
  • Joined

  • Last visited

Community Reputation

2 Neutral

1 Follower

About lucian112

  • Rank
    Member
  • Birthday

Profile Information

  • Gender
    Male
  • Location:
    Romania
  • Interests
    Comunity helping in unity 3d!

Contact Methods

Recent Profile Visitors

453 profile views
  1. Hello guys,i made build system like rust but is not working. Here is download link for my project,and i don;t know what is wrong https://www.dropbox.com/s/vvguwhe4qnzdd0y/TestUnitScr.rar?dl=0 System is made by this tutorial The problem is the cycle menu is not showing
  2. Hello guys,i have one question! How it made in rust leagacy airdrop system? It is exist a tutorial on the internet?
  3. Hello guys! I have a question. Can i make a player to teleport on specify cords like x,y,z?I have a script when player fall,to teleport on cords,but i want now to teleport back when is colision like with a bullet. Here is my script using UnityEngine; using System.Collections; public class respawn : MonoBehaviour { public float threshold; void FixedUpdate() { if (transform.position.y < threshold) transform.position = new Vector3(9, 180, 10); } } Thanks! Srry for bad languege or explain
  4. Hello guys. I have a question. Is existed a script(or tutorial) on internet when player die on multiplayer like when colision with bullet to respawn on checkpoint?
  5. Hello guys. I need help. Can anyoane to help me with script or other to make on my multiplayer game to hide a camera. like in fps cam for player who control his charachter to show his gun in fps just for others -players to not showing his view in his hand,like fps arms. Thanks
  6. Here is my first script,it is about shooting. Easy to use,just create empty game object on charachter camera. I forge to put script: using UnityEngine; using System.Collections; public class Shooting : MonoBehaviour { public Rigidbody projectile; public float speed = 30f; void Start() { Cursor.visible = false; } // Update is called once per frame void Update() { if (Input.GetButtonUp("Fire1")) { Rigidbody instantiatedProjectile = Instantiate(projectile, transform.position, transform.rotation) as Rigidbody; instantiatedProjectile.velocity = transform.TransformDirection(new Vector3(0, 0, speed)); } } } And one more thing. On bullet need to add raycast,and mass need to be 0.05(bullet prefab can be a sphere,cilindre,cube,etc.... just is obligatory to have raycast for work!)
  7. I can't find semicolon. You can be exactly please?
  8. I have this error: Assets/CircularMenu.cs(59,5): error CS1002: ; expected Script: using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Collections.Generic; using UnityEngine.UI; public class CircularMenu : MonoBehaviour { public List<MenuButton> buttons = new List<MenuButton>(); private Vector2 Mouseposition; private Vector2 fromVector2M = new Vector2(0.5f,1.0f); private Vector2 centercirlce = new Vector2(0.5f, 0.5f); private Vector2 toVector2M; public int menuItems; public int CurMenuItem; private int OldMenuItem; // Use this for initialization void Start () { menuItems = buttons.Count; } // Update is called once per frame void Update () { GetCurrentMenuItem(); if (Input.GetButtonDown("Fire1")) ButtonAction(); } public void GetCurrentMenuItem() { Mouseposition = new Vector2 (Input.mousePosition.x, Input.mousePosition.y); toVector2M = new Vector2(Mouseposition.x/Screen.width, Mouseposition.y/Screen.height); float angle = (Mathf.Atan2(fromVector2M.y = centercirlce.y, fromVector2M.x - centercirlce.x) - Mathf.Atan2(toVector2M.y = centercirlce.y, toVector2M.x - centercirlce.x)) = Mathf.Rad2Deg; if (angle < 0) angle += 360; CurMenuItem = (angle / (360 / menuItems)); if(CurMenuItem != OldMenuItem) { buttons[OldMenuItem].sceneimage.color = buttons[OldMenuItem].NormalColor; OldMenuItem = CurMenuItem; buttons[CurMenuItem].sceneimage.color = buttons[OldMenuItem].HighlightedColor; } } public void ButtonAction() { buttons[CurMenuItem].sceneimage.color = buttons[CurMenuItem].PressedColor; if(CurMenuItem == 0) print("You have pressed the buttonn") } } [System.Serializable] public class MenuButton { public string name; public Image sceneimage; public Color NormalColor = Color.white; public Color HighlightedColor = Color.grey; public Color PressedColor = Color.gray; } Thanks
  9. Thanks,and i'm so sorry for spaming and my small info on programing
  10. Hello,here is my script,srry a lot for spaming,just i try to make a game by a tutorial of youtube. Here is error: error CS1525: Unexpected symbol `if' Script: using System.Collections; using System.Collections.Generic; using UnityEngine; public class BuildingSystem : MonoBehaviour { public List<buildObject> objects = new List<buildObject>(); public buildObject currentobject; private Vector3 currentpos; private Vector3 currentrot; public Transform currentpreview; public Transform cam; public RaycastHit hit; public LayerMask layer; public float offset = 1.0f; public float gridSize = 1.0f; public bool IsBuilding; public MCFace dir; void Start() { ChangeCurrentBuilding(0); Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; } void Update() { if (IsBuilding) startPreview(); if (Input.GetButtonDown("Fire1")) Build(); if (Input.GetButtonDown("0") || Input.GetButtonDown("1")) switchCurrentBuilding (); } public void switchCurrentBuilding() { for(int i = 0; i < 2; i++) { if (Input.GetKeyDown("" + 1)) ChangeCurrentBuilding(i); } } public void ChangeCurrentBuilding(int cur) { currentobject = objects[cur]; if (currentpreview != null) Destroy(currentpreview.gameObject); GameObject curprev = Instantiate(currentobject.preview, currentpos, Quaternion.Euler (currentrot) ) as GameObject; currentpreview = curprev.transform; } public void startPreview() { if (Physics.Raycast(cam.position, cam.forward, out hit, 10, layer)) { if (hit.transform != this.transform) showPreview(hit); } } public void showPreview(RaycastHit hit2) { if(currentobject.sort == objectsorts.floor) { dir = GetHisFace(hit2); if(dir == MCFace.Up || dir == MCFace.Down) { currentpos = hit2.point; } else { if (dir == MCFace.North) currentpos = hit2.point + new Vector3(0, 0, 2); if (dir == MCFace.South) currentpos = hit2.point + new Vector3(0, 0, -2); if (dir == MCFace.East) currentpos = hit2.point + new Vector3(2, 0, 0); if (dir == MCFace.Weast) currentpos = hit2.point + new Vector3(-2, 0, 0); } } else currentpos = hit2.point; currentpos -= Vector3.one * offset; currentpos /= gridSize; currentpos = new Vector3(Mathf.Round(currentpos.x), Mathf.Round(currentpos.y), Mathf.Round(currentpos.z)); currentpos *= gridSize; currentpos += Vector3.one * offset; currentpreview.position = currentpos; currentpreview.position = currentpos; if (Input.GetButtonDown("Fire2")) currentrot += new Vector3(0,90,0); currentpreview.localEulerAngles = currentrot; } public void Build() { PreviewObjects PO = currentpreview.GetComponent<PreviewObjects>(); if (PO.IsBuildable) { Instantiate(currentobject.prefab, currentpos, Quaternion.Euler (currentrot) ); } } public static MCFace GetHisFace(RaycastHit hit) { Vector3 incomingVec = hit.normal - Vector3.up; if(incomingVec == new Vector3(0,-1,-1) ) return MCFace.South if(incomingVec == new Vector3(0, -1, 1)) return MCFace.North; if(incomingVec == new Vector3(0, 0, 0)) return MCFace.Up; if(incomingVec == new Vector3(1, 1, 1)) return MCFace.Down; if(incomingVec == new Vector3(-1, -1, 0)) return MCFace.Weast; if(incomingVec == new Vector3(1, -1, 0)) return MCFace.East; return MCFace.None; } } [System.Serializable] public class buildObject { public string name; public GameObject prefab; public GameObject preview; public objectsorts sort; public int gold; } public enum MCFace { None, Up, Down, East, Weast, North, South }
  11. I resolv. I put accidentaly ;. Script need just , on the last part. Thanks any way
  12. Thanks guys,i reming with one error: Assets/PreviewObjects.cs(75,10): error CS1525: Unexpected symbol `;', expecting `,', `}', or `='
  13. Thanks,is resolv,just the same errors stay on preview.