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.

Gamerzin

Newbie
  • Content Count

    15
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Gamerzin

  • Rank
    Newbie
  • Birthday 03/22/1993

Profile Information

  • Gender
    Male
  • Location:
    US

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Gamerzin

    Fps kit 3.0 (photon problem)

    Next, I bought the FPS Kit 3.0 and the FPS Kit 2.0 When I will import it to the Unity 5.5.0 F3 it pops up this error in photon, can someone help me? I don't know what to do!!!
  2. I need a tutorial or script to make the move to "walk" the gun. And in that same Script, I want to make a transition from "walk" to "run" when the "Shift" button is selected and the "walk" will normally walk with the "W" key. (Is there any possibility of doing this in an "animation" without using "animator"?) ----------------- I have a script, but I need a new one. In what I have this giving incompatibilities and when I go to pushing the key to "run", it practically goes without any smoothing, it is as if the animation was totally cut and started from a different point. My script : using UnityEngine; using System.Collections; public class moveAnim : MonoBehaviour { public Rigidbody rb; public Animation anim; public AnimationClip walk; public AnimationClip idle; public AnimationClip reload; public AnimationClip walkingReload; public AnimationClip sprint; public AnimationClip crouch; public AnimationClip crouchWalk; float sprintMult = 1; public bool pauseWalkOnAim = true; void Awake() { if(rb.GetComponent<characterControls>() != null) { sprintMult = rb.GetComponent<characterControls>().sprintMultiplier; } } void FixedUpdate() { characterControls cc = rb.GetComponent<characterControls>(); if (crouch != null) { if (cc.body.height == cc.normalHeight) { if (reload != null) { if (!anim.IsPlaying(reload.name) && !anim.IsPlaying(walkingReload.name)) { if (rb.velocity.magnitude >= 0.1f) { float sprintSpeed = rb.GetComponent<characterControls>().speed * sprintMult; if (rb.GetComponent<characterControls>().curSpeed < sprintSpeed) { if (pauseWalkOnAim) { if (!Input.GetMouseButton(1)) {a anim.CrossFade(walk.name); } } else { anim.CrossFade(walk.name); } } else { if (sprint != null) { anim.CrossFade(sprint.name); } } } else { anim.CrossFade(idle.name); } } else { if (reload != null) { if (anim.IsPlaying(reload.name) && rb.velocity.magnitude > 0.1f) { anim.CrossFade(walkingReload.name); } if (anim.IsPlaying(walkingReload.name) && rb.velocity.magnitude == 0) { anim.CrossFade(reload.name); } } } } else { if (rb.velocity.magnitude > 0.1f) { if (Input.GetKey(KeyCode.LeftShift)) { anim.CrossFade(sprint.name); } else { if (pauseWalkOnAim) { if (!Input.GetMouseButton(1)) { anim.CrossFade(walk.name); } } else { anim.CrossFade(walk.name); } } } else { anim.CrossFade(idle.name); } } } else { if (rb.velocity.magnitude <= 0.1f) { anim.CrossFade(crouch.name); } else { anim.CrossFade(crouchWalk.name); } } } else { if (reload != null) { if (!anim.IsPlaying(reload.name) && !anim.IsPlaying(walkingReload.name)) { if (rb.velocity.magnitude >= 0.1f) { float sprintSpeed = rb.GetComponent<characterControls>().speed * sprintMult; if (rb.GetComponent<characterControls>().curSpeed < sprintSpeed) { if (pauseWalkOnAim) { if (!Input.GetMouseButton(1)) { anim.CrossFade(walk.name); } } else { anim.CrossFade(walk.name); } } else { if (sprint != null) { anim.CrossFade(sprint.name); } } } else { anim.CrossFade(idle.name); } } else { if (reload != null) { if (anim.IsPlaying(reload.name) && rb.velocity.magnitude > 0.1f) { anim.CrossFade(walkingReload.name); } if (anim.IsPlaying(walkingReload.name) && rb.velocity.magnitude == 0) { anim.CrossFade(reload.name); } } } } else { if (rb.velocity.magnitude > 0.1f) { if (Input.GetKey(KeyCode.LeftShift)) { anim.CrossFade(sprint.name); } else { if (pauseWalkOnAim) { if (!Input.GetMouseButton(1)) { anim.CrossFade(walk.name); } } else { anim.CrossFade(walk.name); } } } else { anim.CrossFade(idle.name); } } } if(pauseWalkOnAim) { if (Input.GetKeyUp(KeyCode.LeftShift)) { if (rb.velocity.magnitude > 0) { anim.CrossFade(walk.name); } else { anim.CrossFade(idle.name); } } } anim[walk.name].speed = rb.velocity.magnitude / rb.GetComponent<characterControls>().speed; } }
  3. Gamerzin

    Help me ( Animation Recoil )

    I have here a script who contains the following configuranções, I have the animations "reload"/"Draw"/"Fire" animation "fire" works with the script and an "animation", the rate of fire works like this: If I have a short animation, the gun shoots faster, if I have an animation of "Fire" long, the gun shoots and after a great time shoots again, I wanted to know how I can modify the script so I have a animations that starts "over" the other for the "rate of fire" to be fast as well. using UnityEngine; using System.Collections; public class gunScript : MonoBehaviour { public int clipSize = 6; public Texture hitMarker; public Animation anim; public AnimationClip shoot; public AnimationClip reload; public AnimationClip draw; [HideInInspector] public int ammo = 0; [HideInInspector] public int oldAmmo = 0; float coolDown = 0; public int maxDamage = 50; public int lowDamage = 30; public bool singleShot = false; public float rateOfFire = 0.1f; public float range = 1500; public float recoilAmnt = 0.2f; public float recoilShake = 5f; public float recoilSpeed = 5f; public Transform forward; public float accuracy = 0.3f; public camRecoil recoilScript; public Transform[] pelletSpawns; public GameObject groundHit; public GameObject bloodHit; public Transform muzzle; public GameObject muzzleFlash; public AudioClip shootSFX; public AudioClip reloadSFX; public int magazines = 10; public PhotonView tpEff; float killCool = 0; float hitMarkerTime = 1; void Awake() { ammo = clipSize; setLayer(); if(drawTracer) { if (muzzle == null) { drawTracer = false; Debug.LogError("Muzzle Trasform Not Set, Draw Trace' Set To Fale"); } } } void Update() { if(killCool > 0) { killCool -= Time.deltaTime; } if (!singleShot) { if (Input.GetButton("Fire1")) { Fire(); } } else { if (Input.GetButtonDown("Fire1")) { FireSingle(); } } if (Input.GetKeyUp(KeyCode.R)) { rel(); } if(coolDown > 0) { coolDown += -Time.deltaTime; } } public bool drawTracer = true; public void Fire() { if (coolDown <= 0 && !anim.IsPlaying(reload.name) && !anim.IsPlaying(draw.name)) { if (ammo > 0) { anim.Play(shoot.name); ammo += -1; coolDown += rateOfFire; if(recoilScript != null) { recoilScript.StartRecoil(recoilAmnt, recoilShake, recoilSpeed); } tpEff.RPC("shootEff", PhotonTargets.All, shootSFX.name); if (muzzleFlash && muzzle != null) { GameObject mf = Instantiate(muzzleFlash, muzzle.position, muzzle.rotation) as GameObject; mf.transform.parent = transform; Destroy(mf, 1); } if (pelletSpawns.Length == 0) { RaycastHit hit; Vector3 fwd = new Vector3(forward.forward.x + Random.Range(-accuracy, accuracy) / 10, forward.forward.y + Random.Range(-accuracy, accuracy) / 10, forward.forward.z); if (Physics.Raycast(forward.position, fwd, out hit, range)) { //draw tracer if (drawTracer) { GameObject line = new GameObject(); line.transform.SetParent(GameObject.Find("_Room").transform); line.name = "tracer"; LineRenderer ln = line.AddComponent<LineRenderer>(); ln.SetWidth(0.01f, 0.005f); ln.material = new Material(Shader.Find("Diffuse")); ln.material.color = Color.yellow; ln.SetPosition(0, muzzle.position); ln.SetPosition(1, hit.point); Destroy(line, 0.05f); } if (hit.transform.tag == "Player") { //Debug.Log("hit!"); if (hit.transform.GetComponent<PhotonView>() != null) { tpEff.gameObject.SendMessage("hitCol", hit.collider); hit.transform.GetComponent<PhotonView>().RPC("ApplyDamage", PhotonTargets.AllBuffered, Random.Range(lowDamage, maxDamage), PhotonNetwork.playerName, hit.collider.name); killCool = hitMarkerTime; //Seconds to show hit marker } GameObject par = Instantiate(bloodHit, hit.point, Quaternion.identity) as GameObject; Destroy(par, 5f); } else { Quaternion hitRotation = Quaternion.FromToRotation(Vector3.up, hit.normal); GameObject par = Instantiate(groundHit, hit.point, hitRotation) as GameObject; Destroy(par, 5f); } } } else { foreach (Transform pelletSpawn in pelletSpawns) { RaycastHit hit; if (Physics.Raycast(pelletSpawn.position, pelletSpawn.forward, out hit, range)) { if (hit.transform.tag == "Player") { Debug.Log("hit!"); if (hit.transform.GetComponent<PhotonView>() != null) { hit.transform.GetComponent<PhotonView>().RPC("ApplyDamage", PhotonTargets.AllBuffered, Random.Range(lowDamage, maxDamage), PhotonNetwork.playerName, hit.collider.name); killCool = hitMarkerTime; //Hitmarker seconds } GameObject par = Instantiate(bloodHit, hit.point, Quaternion.identity) as GameObject; Destroy(par, 5f); } else { Quaternion hitRotation = Quaternion.FromToRotation(Vector3.up, hit.normal); GameObject par = Instantiate(groundHit, hit.point, hitRotation) as GameObject; Destroy(par, 5f); } } } } } else { rel(); } } } public void FireSingle() { if (!anim.IsPlaying(shoot.name) && !anim.IsPlaying(reload.name) && !anim.IsPlaying(draw.name)) { if (ammo > 0) { anim.Play(shoot.name); ammo += -1; coolDown += rateOfFire; tpEff.RPC("shootEff", PhotonTargets.All, shootSFX.name); if (recoilScript != null) { recoilScript.StartRecoil(recoilAmnt, recoilShake, recoilSpeed); } if (muzzleFlash && muzzle != null) { GameObject mf = Instantiate(muzzleFlash, muzzle.position, muzzle.rotation) as GameObject; mf.transform.parent = transform; Destroy(mf, 1); } if (pelletSpawns.Length == 0) { RaycastHit hit; Vector3 fwd = new Vector3(forward.forward.x + Random.Range(-accuracy, accuracy) / 10, forward.forward.y + Random.Range(-accuracy, accuracy) / 10, forward.forward.z); if (Physics.Raycast(forward.position, fwd, out hit, range)) { //draw tracer if (drawTracer) { GameObject line = new GameObject(); line.transform.SetParent(GameObject.Find("_Room").transform); line.name = "tracer"; LineRenderer ln = line.AddComponent<LineRenderer>(); ln.SetWidth(0.01f, 0.005f); ln.material = new Material(Shader.Find("Diffuse")); ln.material.color = Color.yellow; ln.SetPosition(0, muzzle.position); ln.SetPosition(1, hit.point); Destroy(line, 0.05f); } if (hit.transform.tag == "Player") { //Debug.Log("hit!"); if (hit.transform.GetComponent<PhotonView>() != null) { tpEff.gameObject.SendMessage("hitCol", hit.collider); hit.transform.GetComponent<PhotonView>().RPC("ApplyDamage", PhotonTargets.AllBuffered, Random.Range(lowDamage, maxDamage), PhotonNetwork.playerName, hit.collider.name); killCool = hitMarkerTime; //hit marker seconds } GameObject par = Instantiate(bloodHit, hit.point, Quaternion.identity) as GameObject; Destroy(par, 5f); } else { Quaternion hitRotation = Quaternion.FromToRotation(Vector3.up, hit.normal); GameObject par = Instantiate(groundHit, hit.point, hitRotation) as GameObject; Destroy(par, 5f); } } } else { foreach (Transform pelletSpawn in pelletSpawns) { RaycastHit hit; if (Physics.Raycast(pelletSpawn.position, pelletSpawn.forward, out hit, range)) { //draw tracer if (drawTracer) { GameObject line = new GameObject(); LineRenderer ln = line.AddComponent<LineRenderer>(); line.transform.SetParent(GameObject.Find("_Room").transform); line.name = "tracer"; ln.SetWidth(0.01f, 0.005f); ln.material = new Material(Shader.Find("Diffuse")); ln.material.color = Color.yellow; ln.SetPosition(0, muzzle.position); ln.SetPosition(1, hit.point); Destroy(line, 0.02f); } if (hit.transform.tag == "Player") { //Debug.Log("hit!"); if (hit.transform.GetComponent<PhotonView>() != null) { hit.transform.GetComponent<PhotonView>().RPC("ApplyDamage", PhotonTargets.AllBuffered, Random.Range(lowDamage, maxDamage), PhotonNetwork.playerName, hit.collider.name); killCool = hitMarkerTime; //hit marker seconds } GameObject par = Instantiate(bloodHit, hit.point, Quaternion.identity) as GameObject; Destroy(par, 5f); } else { Quaternion hitRotation = Quaternion.FromToRotation(Vector3.up, hit.normal); GameObject par = Instantiate(groundHit, hit.point, hitRotation) as GameObject; Destroy(par, 5f); } } } } } else { rel(); } } } public void rel() { if (ammo < clipSize && magazines > 0) { oldAmmo = ammo; anim.CrossFade(reload.name); ammo = clipSize; magazines += -1; tpEff.RPC("reload", PhotonTargets.AllBuffered, reloadSFX.name); } } void OnEnable() { anim.Play(draw.name); } void OnDisable() { if (anim.IsPlaying(reload.name)) { ammo = 0; magazines += 1; } } void OnGUI() { if (GameObject.Find("_Room") != null) { GUI.skin = GameObject.Find("_Room").GetComponent<roomManager>().skin; } GUIStyle ammoStyle = new GUIStyle(GUI.skin.box); ammoStyle.fontSize = 36; GUIStyle ammoStyle2 = new GUIStyle(GUI.skin.box); ammoStyle2.fontSize = 24; ammoStyle2.alignment = TextAnchor.MiddleLeft; GUI.Label(new Rect(10, Screen.height - 100, 100, 50), ammo + "/" + clipSize, ammoStyle); GUI.Box(new Rect(100, Screen.height - 100, 50, 50), "/" + magazines, ammoStyle2); //hitMarker if(hitMarker != null) { if (killCool > 0) { Color c = Color.white; c.a = killCool; GUI.color = c; float hMLength = hitMarker.width / 2; GUI.DrawTexture(new Rect(Screen.width / 2 - hMLength, Screen.height / 2 - hMLength, hMLength * 2, hMLength * 2),hitMarker, ScaleMode.StretchToFill); } } } public void setLayer() { foreach (MeshRenderer mr in gameObject.GetComponentsInChildren<MeshRenderer>()) { mr.gameObject.layer = 9; } foreach (SkinnedMeshRenderer mr in gameObject.GetComponentsInChildren<SkinnedMeshRenderer>()) { mr.gameObject.layer = 9; } } }
  4. I don't know how I didn't think of it that way, I did and it worked. It is something so simple but I did not find on Youtube, maybe I do a tutorial for guys
  5. I think you've figured it out, but games like COD and Battlefield when we reload the gun, the camera makes moves to demonstrate realism. I wanted to know how I can do this in my game, knowing that the camera is in the "Layer" from above. How can I animate the camera that is on top, for a Layer that is down? Is it possible? I need some Script that moves something from the top using the bottom one. See in the video to get an idea of what I'm talking about, notice the player's camera when it reloads :
  6. Gamerzin

    Security Check bug

    Hey admin, Security check is with a bug, a partner of mine has been registering the account, but when the verification step is missing, the "security check" simply disappears.
  7. Gamerzin

    Gun camera reload shake

    Is there any way to place the properties of an object that is up on the bottom? For example: Put the properties of the "ReloadCam" in the animation of "AksFire" and make the movement of the top property down there in another completely different property?
  8. Gamerzin

    Fps kit ww2 (Help/Photon)

    I finished editing the Oma kit "Au kit FPS 2" whole, put new animations, put new weapons and sounds, new phases, weapons modifications, menu and everything. However I need help to let you multiplayer using the Photon, I found no tutorial, if anyone can help me I will be thankful for thanks.
  9. Gamerzin

    Fps kit Mobile

    Thanks
  10. Gamerzin

    Fps kit Mobile

    this kit: it's possible?!
  11. Gamerzin

    Fps kit Mobile

    Can you tell me a tutorial?
  12. Gamerzin

    Fps kit Mobile

    is it possible to convert a fps mobile phone kit to a computer?
  13. Gamerzin

    Oma Fps Kit With Multiplayer

    Still have the kit? I really need
  14. Gamerzin

    Oma Fps Kit With Multiplayer

    Please ,repost the unity kit multiplayer....
×