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.

IAskQUESTIONS

Newbie
  • Content count

    16
  • Joined

  • Last visited

Community Reputation

2 Neutral

2 Followers

About IAskQUESTIONS

  • Rank
    Newbie

Profile Information

  • Gender
    Not Telling
  • Location:
    What dis
  • Interests
    Stuff
  1. Money Making: How did YOU get Premium?

    I mow lawns on my weekends and make like 40 dollars every weekend. I also play an online game and make currency and then sell the online currency for USD. Granted I don't have Premium I thought I could post my ways of getting money here as I have over 200$ in my wallet currently. #Paretnswon'tletmehavepaypal
  2. Two Simple Questions

    Second question has been solved, now looking for answer to first question.
  3. Two Simple Questions

    Hey guys, so I'm having two problems, this is the first. I'm trying to figure out how to modify this muzzle flash script so that it changes between an array of textures, any help there? var MuzzleFlash : Renderer; var MuzzleLight : Light; function Start () { MuzzleFlash.enabled = false; MuzzleLight.enabled = false; } function Shoot () { MuzzleFlash.renderer.enabled = true; MuzzleLight.enabled = true; yield WaitForSeconds(0.02); MuzzleFlash.renderer.enabled = false; MuzzleLight.enabled = false; } And my second question, I would like for my gun to actually have spread when fired instead of being a "laser beam" var hit : RaycastHit; var DirectionRay : Vector3 = transform.forward; var obj = Instantiate (Trail, transform.position, Quaternion.identity) as GameObject; obj.rigidbody.AddForce (DirectionRay * Force, ForceMode.VelocityChange); Debug.DrawRay(transform.position, DirectionRay * Range, Color.red); if(Physics.Raycast(transform.position , DirectionRay , hit, Range)){
  4. LionsYard Games (Unity3dFPS)

    Grafit - Be Free
  5. Burst Fire?

    How would I add burstfire to a shooting script? As of now I only know how to do semi auto and full auto fire but burst fire is really confusing me. If you need to see the shooting script I can post it... this really has be stumped.
  6. Muzzle Flash Switching?

    Shader? I don't work with shaders as of now. I don't even understand how they work lol. But when I hop on my normal computer with all of my scripts I will check out the script.
  7. Muzzle Flash Switching?

    How would I switch out between textures on a muzzle flash, at the moment it is just the same texture repeating over and over again but how would I switch them out randomly? If you need the script I can probably post it.
  8. Screen Recording?

    When I maximize the window it still shows the file/assests/gizmos/etc. bar in the top of the screen.
  9. Screen Recording?

    How do people record the full screen in Unity? In most of the videos I watch the gizmos/stats bar is not at the top of their fullscreen mode. Even in small updates, so how do they record it like that and what program might they be using?
  10. Recoiling Troubles

    Hey guys, I'm wondering why the recoil part of my script isn't working. Everything can be found under "Raycast Shoot" and then at the bottom in the Recoiling function. Thanks in advance if you can help. Script: var Range : float = 1000; var Force : float = 1000; var Clips : int = 3; var BulletsPerClip : int = 10; var ReloadTime : float = 2; var BulletsLeft : int = 0; var ShootTimer : float = 0; var ShootCooler : float = .5; public var ShootAudio : AudioClip; public var ReloadAudio : AudioClip; var Damage : int = 10; var MuzzleFlash2 : Renderer; var MuzzleLight2 : Light; var Trail : GameObject; var recoilMod : Transform; var weapon : GameObject; var maxRecoil_x : float = -20; var recoilSpeed : float = 10; var recoil : float = 0.0; function Start () { BulletsLeft = BulletsPerClip; MuzzleFlash2.enabled = false; MuzzleLight2.enabled = false; } function Update () { if(ShootTimer > 0){ ShootTimer -= Time.deltaTime; } if (ShootTimer < 0){ ShootTimer = 0; } if (Input.GetButton("Fire1") && BulletsLeft) { if(ShootTimer == 0){ recoil+= 0.1; PlayShootAudio(); RayShoot(); ShootTimer = ShootCooler; MuzzleOn(); Recoiling(); } Recoiling(); } if(Input.GetButtonDown("Reload") && BulletsLeft) { Reload(); } } function RayShoot () { GameObject.Find("AnimHolder").animation.Play("RecoilG36"); var hit : RaycastHit; var DirectionRay : Vector3 = transform.forward; var obj = Instantiate (Trail, transform.position, Quaternion.identity) as GameObject; obj.rigidbody.AddForce (DirectionRay * Force, ForceMode.VelocityChange); Debug.DrawRay(transform.position, DirectionRay * Range, Color.red); if(Physics.Raycast(transform.position , DirectionRay , hit, Range)){ if(hit.rigidbody){ hit.rigidbody.AddForceAtPosition(DirectionRay * Force, hit.point); hit.collider.SendMessageUpwards("ApplyDamage", Damage, SendMessageOptions.DontRequireReceiver); } } BulletsLeft --; if (BulletsLeft < 0){ BulletsLeft = 0; } if (BulletsLeft == 0){ Reload(); } } function Reload () { //GameObject.Find("Pistol Right").animation.Play("ReloadPistol"); PlayReloadAudio(); yield WaitForSeconds(ReloadTime); if (Clips > 0){ BulletsLeft = BulletsPerClip; Clips -= 1; } } function PlayShootAudio () { audio.PlayOneShot(ShootAudio); } function PlayReloadAudio () { audio.PlayOneShot(ReloadAudio); } function MuzzleOn () { MuzzleFlash2.renderer.enabled = true; MuzzleLight2.enabled = true; yield WaitForSeconds(0.02); MuzzleFlash2.renderer.enabled = false; MuzzleLight2.enabled = false; } function Recoiling () { if(recoil > 0) { var maxRecoil = Quaternion.Euler (maxRecoil_x, 0, 0); // Dampen towards the target rotation recoilMod.rotation = Quaternion.Slerp(recoilMod.rotation, maxRecoil, Time.deltaTime * recoilSpeed); weapon.transform.localEulerAngles.x = recoilMod.localEulerAngles.x; recoil -= Time.deltaTime; } else { recoil = 0; var minRecoil = Quaternion.Euler (0, 0, 0); // Dampen towards the target rotation recoilMod.rotation = Quaternion.Slerp(recoilMod.rotation, minRecoil,Time.deltaTime * recoilSpeed / 2); weapon.transform.localEulerAngles.x = recoilMod.localEulerAngles.x; } }
  11. Crosshair not showing?

    Thanks man, I didn't even notice that *facepalm*
  12. Crosshair not showing?

    Why does it still not work though?
  13. Crosshair not showing?

    I don't think that was the problem because for some reason it still won't draw itself. :c I don't know if it's anything to do with colors though. Whenever I change the colors around in the inspector nothing different happens (With both sliders).
  14. Crosshair not showing?

    Hey guys, I'm back with yet another problem. I haven't't been able to figure out how or why my crosshair won't show up on my screen. I'm pretty sure there is nothing wrong with the script but for some reason whenever I put an image on the texture box nothing shows up. It's something with drawing the crosshair because the object checker works perfectly fine. #pragma strict var crossText : Texture2D; var size : float = 32; var crossColor : Color32; //Raycasting Bro var rayOrigin : Transform; var rayRange : float = 33; function Update () { //Object Checker ----------------------------------------------------------------------------- var direction : Vector3 = rayOrigin.forward; var hit : RaycastHit; if (Physics.Raycast(rayOrigin.position, direction, hit, rayRange)){ if (hit.collider.gameObject.tag == "Enemy"){ crossColor = Color.red; } else if (hit.collider.gameObject.tag == "Friendly"){ crossColor = Color.green; } else{ crossColor = Color.white; } } else{ crossColor = Color.white; } //---------------------------------------------------------------------------------------------- Screen.lockCursor = true; } function onGUI () { GUI.color = crossColor; GUI.DrawTexture(Rect(Screen.width/2 - size/2, Screen.height/2 - size/2, size,size), crossText); }
  15. Aim Down Sights Problem

    So just take away the transform?
×