Monday, February 25, 2019

Unity 3d PickUp System with animation full script by allunityscripts

Pick Up Scripts

unity 3d PickUp system full script


using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PickUp : MonoBehaviour {

    Animator anim;
    Inventory invScript;

    public bool money;
    public int moneyAmount;
    Currency moneyScript;

    public bool item;
    public GameObject itemIcon;

    bool pickedUp = false;
 

// Use this for initialization
void Start () {

        anim = GameObject.FindWithTag("Player").GetComponent<Animator>();
        moneyScript = GameObject.FindWithTag("GameController").GetComponent<Currency>();
        invScript = GameObject.FindWithTag("GameController").GetComponent<Inventory>();
    }

// Update is called once per frame
void OnTriggerStay(Collider player) {
        if (player.tag == "Player")
        {
            if (Input.GetKeyDown(KeyCode.E) && !pickedUp)
            {
                pickedUp = true;
                StartCoroutine("PlayAnim");
            }
        }
}

    IEnumerator PlayAnim()
    {
        anim.SetTrigger("pickup");
        yield return new WaitForSeconds(1);
        if (money)
        {
            moneyScript.gold += moneyAmount;
            Destroy(gameObject);
        }
        else if (item)
        {
            GameObject i = Instantiate(itemIcon);
            i.transform.SetParent(invScript.invTab.transform);
            Destroy(gameObject);
        }
    }
}

3 comments:

  1. Thanks for sharing this useful information. Everyone can also enhance their skills by doing some IT Certifications like HP2-H84 questions Exam to improve their competency.

    ReplyDelete
  2. good script i need many scripts

    ReplyDelete
  3. 3D Animation https://pinksquare.com/3d-animation/ : Just What the Doctor Ordered

    The animation market is huge- it was worth over $254 billion dollars back in 2017. We, however, don't expect it to stop there. This industry is sure to develop, especially now that it has proved to be an effective marketing tool.

    3D animation is traditionally a reserve of the entertainment industry. This is largely because of its capability to arouse emotion and captivate. These days, however, animation is present beyond the cinema halls -being utilized to showcase products.

    Does 3D animation beat traditional methods of showcasing products?

    Well, Extremely Effective!

    Just look at brand names like Gillette and Apple. With Gillette, for example, a boring shave is transformed into a 3D adventure. Now consider at the extent of trust the marketing method garners for the brand. Gillette was smart enough to realize that to rise above the competition, it had to move away from generic advertising. The quality of the animation is regarded reflective of the brand's quality. That is exactly what a good 3D product animation will do for your brand; it will make you stand shoulders above the competition.

    There are three major reasons why you must add 3D animation to your marketing stratagem:

    1.Prototyping Made Simple: Prototypes are very expensive. To be fair, they do get the job done but, what if there was a cheaper alternative? Well, now you can. 3D product animation models your product in a virtual world and exposes it to the market. This way, you get the feedback synonymous with prototypes without the expense.

    2.First Impressions Matter Most: Products are hardly entertaining to look at. Imagine the Gillette brand without the 3D animation. How boring would that have been?

    3D product animation has the capability to transform even the most boring of products into a blockbuster. Every product is attractive in a virtual world- especially after a few special effects. Use animation to strike a chord with the market of interest.

    Apple's iPhone X is a good example of this trend. Apple invested greatly on 3D product animation to get the phone noticed. Other brands that have utilized 3D product animations efficiently are Samsung, Microsoft, and Huawei. It is no wonder they dominate their markets.

    3. All about The Money: 3D product animation will save you lots of money. The animation can be utilized long before the marketing phase to determine problems in the product design. Designers can change the product after evaluating its model without physical prototyping.

    On top of that, animation is a very cost-effective marketing system. Just look at the popularity of 3D modelling rigs and Virtual Reality equipment to have a feel of just how hungry the world is for 3D.

    In a nutshell, animation technologies will bring good tidings to your product. They add mystique, suspense, and glamor to products. The animation process also makes the brand feel modern and worthy of a place in the contemporary market. You will be pleased to know just how many great products fail to sell due to how they introduced themselves to the market.

    Don't add to that sad statistic. Spice things up. Make your item the hero of an animated advertisement. You do want to be the next Apple and Huawei, don't you?

    ReplyDelete