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.

Tntcommando1

Newbie
  • Content Count

    10
  • Joined

  • Last visited

  • Days Won

    2

Tntcommando1 last won the day on May 7 2017

Tntcommando1 had the most liked content!

Community Reputation

7 Neutral

About Tntcommando1

  • Rank
    Newbie
  • Birthday 11/26/1980

Profile Information

  • Gender
    Male
  • Location:
    Not Telling

Recent Profile Visitors

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

  1. Destroy the character then spawn it again.
  2. It was a cool script that I made, hope you like it! http://www.mediafire.com/file/6vwa6q33c3fxi3q/blockPlacerAsset.unitypackage
  3. You should have 2 buttons to flip forward or backward in the book.
  4. These are not my assets, but they are handy and... FREE! Website: www.devassets.com
  5. Here are some photos and a video!
  6. I made a door script for anyone to use, and I have also included a prefab to easily put in your game. doorDemoAssets.unitypackage
  7. I didn't know how to approach the weapon switch script and I haven't really had the time to optimize it. Thanks for the reply and help!
  8. Here is a script that I found on the unity forums. https://forum.unity3d.com/threads/simplle-free-fly-camera-script.167604/ Hope this is what you wanted, TNT
  9. I am trying to make a switch weapon script but, I am not able to switch my weapons with the scroll wheel. Here is my script if someone would like to help. using System.Collections; using System.Collections.Generic; using UnityEngine; public class WeaponSwitch : MonoBehaviour { public GameObject[] weapons; // push your prefabs public int currentWeapon = 0; private int nrWeapons; void Start() { nrWeapons = weapons.Length; SwitchWeapon(currentWeapon); // Set default gun } void Update() { for (int i = 1; i <= nrWeapons; i++) { if (Input.GetKeyDown(KeyCode.Alpha1)) { currentWeapon = i - 1; SwitchWeapon(0); } if (Input.GetKeyDown(KeyCode.Alpha2)) { currentWeapon = i - 1; SwitchWeapon(1); } if (Input.GetKeyDown(KeyCode.Alpha3)) { currentWeapon = i - 1; SwitchWeapon(2); } if (Input.GetAxis("Mouse ScrollWheel") > 0f) { currentWeapon = i - 1; SwitchWeapon(i - 1); } else if(Input.GetAxis("Mouse ScrollWheel") < 0f) { currentWeapon = i - 1; SwitchWeapon(i + 1); } } } void SwitchWeapon(int index) { for (int i = 0; i < nrWeapons; i++) { currentWeapon = index; if (i == index) { weapons[i].gameObject.SetActive(true); } else { weapons[i].gameObject.SetActive(false); } } } }
×
×
  • Create New...