Issue#1432: Unity - Very basic Inventory script

  • Hello,

    I am a beginner in programming with Unity!
    I do know the very basics, like arrays, lists, variables etc.

    But one thing i just can't create is an inventory,
    Can you give me soms basics of how to create an inventory.
    Im not asking for an complete script, because i really want to learn to write it myself.

    I'm quit sure i need to use arrays or lists, but i really have no clue.
    I've looked it up on the internet, but i couldn't find a decend tutorial, only for advanced programmers.

    I...

    Very basic Inventory script

    0 Answers

    Sorry, your answer is too short !

  • Issue#33435: Unity - Brackey's Inventory Equipment Effect Issue

    I am having an issue with the equipment effect script that comes with brackey's inventory. I applied this script to my weapon in the scene. When I equip it, the effect adds the damage, but when I unequip, it it does not remove the damage. When I drop the item from inventory, it removes the damage. Here is the Equipment Effect Script Code (JavaScript): #pragma strict   //This script allows you to create equipment effects that will be called either OnEquip or WhileEquipped. This is usefull for... Brackey's Inventory Equipment Effect Issue

  • Issue#40906: Unity - Does any one have a basic script to get my 2d character moving?

    I have the rigid body 2d and all of the box colliders for my scene. all I need now is a player movement script but all of the tutorials I watch end up not working or getting errors. Does anyone know how to construct a character controller?

  • Issue#105296: Unity - Basic Destroy Gameobject Script Not Working

    OK, this is odd. I can't get this to work. Code (CSharp): using UnityEngine; using System.Collections;   public class Destroy : MonoBehaviour {     public GameObject Player;     void Start () {         if (Input.GetButtonDown("Fire1"))         {             Destroy (Player);         }     } I attach the script to a gameobject in the scene and set the Player. Obviously, doing something wrong. I've googled and tried a different handful after my own attempts and obviously I am overlooking... Basic Destroy Gameobject Script Not Working

  • Issue#113407: Unity - New Building Script & Inventory Master

    Hi all, I am coding my first project with Unity and I have been using a few different assets as well as coding my own. I am using a Asset from the store called "Inventory Master". I have been reading, understanding and editing the code to ensure I know how it all works. I want to integrate a building system with it. e.g. when I right click an item e.g. a building from the inventory, it closes down the windows and enters a building mode with the prefab of that item. Any ideas how I would... New Building Script & Inventory Master

  • Issue#113863: Unity - Beginner: Basic Health Managing Script

    Hi guys, two weeks ago in started to venture into the world of Unity and scripting. As i'm a complete beginner i followed some tutorials on Unity Learn and achieved some basic understanding of how to code in C#. Now rewrite some code i found in tutorials and try to write it by myself. Right now i try to attach a script which should inflict "damage" to my player onto a cube and a "health managing system" to my player. PlayerHealthManager Code (csharp):   using UnityEngine; using... Beginner: Basic Health Managing Script

  • Issue#120604: Unity - Weird issue with my lerping script

    I have a script that's supposed to make a GameObject lerp from 78.9 as long as a certain light is true and its intensity is greater than 0. Here's the script... Code (JavaScript): #pragma strict var UI : GameObject; var flashLight : Light; var fadeTime : float = 0.20763; var startPosition : float = 78.9; function Start () {     flashLight.GetComponent.<Light>().enabled = true;     UI.transform.position.y = startPosition; } function Update () {   if(flashLight.GetComponent.<Light>().enabled ==... Weird issue with my lerping script

  • Issue#122023: Unity - Optimizing Inventory Script

    Hi all, I have made a script which manages all objects the player picks up in my game and puts it in the inventory, which works fine by itself only the length is becoming ridiculous only with 6 items the player can pick up now. I was hoping someone could give me some advice on how to make my script shorter and more clear. Same is for the crafting of the items which is in the same script. I am sorry for the amount of code I am posting here but not sure how to make clear what it is about... Optimizing Inventory Script

  • Issue#249025: Unity - Issue with AnimationClip creation via script

    Hello, I'm facing a weird behaviour with a script that : 1) registers an object's transform at each frame 2) creates AnimationCurves with that datas 3) puts these curves to an AnimationClip 4) saves this clip into an .anim file. Long story short, I have noticed that some of the datas (e.g local X/Y/Z position, or euler angles...) are not correctly recorded. I went debugging deeply through my code, and here is a snippet that I would like some explanations on the result it is giving me :... Issue with AnimationClip creation via script

  • Issue#259467: Unity - Basic script problem

    Hi, i am new with unity and i have a little problem that maybe you can help me with. I followed the instruccions on this tutorial, but when i try to move my player it do nothing. Tutorial: http://unity3d.com/es/learn/tutorials/projects/2d-ufo-tutorial/controlling-player?playlist=25844 I dont know why, the code is the same so i hope someone can help me. Thank you for reading and excuse my english.

  • Issue#285325: Unity - Help with my inventory script

    I have a code that works in making different objects in my inventory be equipped when the corresponding inputs are used. Here's the script... Code (JavaScript): var radio : GameObject; var map : GameObject; var pipe : GameObject;   function Start () {     radio.SetActive (false);     map.SetActive (false);     pipe.SetActive (false); } function Update () {     if (Input.GetButtonUp("Fire2") && Input.GetKey("d"))          {          map.SetActive (true);          radio.SetActive (false);... Help with my inventory script

  • Issue#296193: Unity - floating game object script issue

    So I'm trying to make a First Person Shooter for mobile. I have these three scripts but every time i go near my 'enemy' my Gun floats off in to the air, I'm new to coding so have no idea what i've done wrong here Code (JavaScript): function OnGUI () {      if (GUI.RepeatButton(Rect(10,70,50,30),"Shoot"))          GoTriggerHappy(); } function Update () {      if (Input.GetAxis("Shoot"))          GoTriggerHappy(); } function GoTriggerHappy () {     if(Input.GetMouseButton(0)) {         var... floating game object script issue

  • Issue#372521: Unity - Very basic flight sim script

    My first post here I have been messing with unity for a while but scripting was out of my league so knuckled down and stopped playing with the bells and whistles which unity has heaps of. I tried to unravel the provided C# scripts but their complexity and intricacy left me with more questions than answers. Anyway after a few weeks I have come up with this most basic of basic flight sim scripts that may be of use to other beginners. You need nothing more than a Main camera, flat basic... Very basic flight sim script

  • Issue#513515: Unity - Issue Regarding Jumping Script

    Hello there.I've written a script for my 3D game and i wrote the part for jumping.The problem that i came across is that my character can only jump if he has moved(eg.if i jump and then stay there and don't move again, the player wont be able to jump again until he moves)!Please if you have any idea on how to fix this, reply!Thanks in advance! Code (csharp):   using UnityEngine; using System.Collections;   public class PlayerController : MonoBehaviour {     // Variables   public float speed;   public... Issue Regarding Jumping Script

  • Issue#686502: Unity - Issue with a Restart Script?

    I've gone through the forum and found help for a restart script and it works, except that when I restart some of my pickups are missing. I'm trying to completely reset the level, because on later levels I will have enemies who will take away from your count so you have to restart to get them all. Thanks for any help!

  • Issue#687000: Unity - Make basic script to collect items?

    Hello all! Sorry for the really stupid question but I'm new to Unity and scripting in general. What I'd like to do is I'd like to have a script that detects when a player has collected seven gems, then triggers an event. I've looked at other tutorials but this is practically my first time using Unity and I can't make heads or tails of them. I know that the gems need colliders on them that are triggers, but that's as far as I know Do I attach the script to collect gems to the player or... Make basic script to collect items?

  • Issue#987686: Unity - Cooldown UI Script Issue (C#)

    Hello my friends, I don't know if I should have posted this on the UI section but since this is all about scripting I posted here. Sorry if I posted on the wrong section. In my game I have a bunch of skills and I'm trying to make a cooldown countdown on the top of the skill icon, but this countdown should only appear when you cast that skills (obviously). For that I created the cooldown logic on the player script (called weapon) and I created another script for the UI count down.... Cooldown UI Script Issue (C#)

  • Issue#1052746: Unity - Basic Slender-like Enemy AI script?

    Hello, everyone. I'm trying to make a script that allows my enemy character to operate in a way similar to the Slender Man from the Slender video game series, except I want my character to run rather than teleport. Before you ask, yes, I've already looked at the Slender guides (both new and old) by AlucardJ. I've been looking at a lot of tutorials, both on YouTube and here on the site, to find them a little useful. But, I'm still finding myself getting lost and frustrated at times. Does... Basic Slender-like Enemy AI script?

  • Issue#1126182: Unity - Issue with Inventory Icons

    Hi all, I ran into a problem that I am having a difficult time trying to wrap my head around so I wanted to see if anyone else has thoughts. I followed a great Inventory tutorial on you tube by awful media and it works great. But I ran into an interesting snag when working on accessing the AddItem function from my inventory script. I have inventory open and close commands that close the inventory panel and character sheet panel but leaves the master inventory (which holds the script)... Issue with Inventory Icons

  • Issue#1149096: Unity - Shooting Script Issue

    Hi everyone, I am having an issue with bullets that have been shot not travelling to their destination as I would like. This is a gyazo of the issue: https://i.gyazo.com/503ff37c9925f170b04f1fb8bb81639f.mp4 As you can see the bullets start off travelling to their destination but then change destination mid-flight. This is how my shooting is currently handled: 1. The player has a child object called 'aim' which is the current facing direction of the player (and therefore... Shooting Script Issue

  • Issue#1484: Unity - Inventory Pro - uGUI - Performance - Mobile support & More

    >> Asset store <<​ >> The demo << ​ More info at http://devdog.nl/product/inventory-pro/ Want to request... Inventory Pro - uGUI - Performance - Mobile support & More

  • Issue#1649: Unity - Add GameObject to the Script of a Prefab

    Hi everyone, I need to create a prefab of four spheres. These spheres are falling down from the top of the scene, and they should move to another invisible sphere (through the MoveTowards method). For this, I've made a script that is attached to each one of the four spheres, that needs these GameObjects: - The sphere (itself). - The target sphere (the final position). There isn't problem with attaching the first GameObject mentioned, but the target spehre is impossible to attacht it on... Add GameObject to the Script of a Prefab

  • Issue#1715: Unity - 2D Level Menu Issue!

    Hello there devs! I am making a 2d game and i just created my level select menu but i seem to be facing a problem.When the player starts, level 1 is automatically unlocked and the player needs to finish it in order to get to level 2.So when level 1 is finished i set in playerprefs the ("UnlockedLevel") parameter to 2 and so on so that the next level unlocks.But, i just realized that if the player pressed on level 1 and then somehow he goes back to the levelmenu scene without finishing it,... 2D Level Menu Issue!

  • Issue#1793: Unity - Vertex/Fragment shader : issue with alpha blending

    Hi. I am having a hard time figuring out an issue I have with a simple alpha blending shader (I had the same kind of issue with alpha test). Here are a few pictures so you get the basic idea : View attachment 170683 View attachment 170684 By simply moving the camera back and force, my shader kind of switch between being displayed and not. These screens are from the Editor, but I have the same issue In Game. However, In Game, another issue comes up :... Vertex/Fragment shader : issue with alpha blending

  • Issue#1839: Unity - iTween issue

    Hi, I got error on the console about this line of code and don't understand how to solve it, anyone can help please ? iTween.ScaleTo(tailleDistance,iTween.Hash("x",15,"y",15,"z",15,"time",1.6,"easetype",iTween.EaseType.easeInOutCubic)); Regards,

  • Issue#2380: Unity - [SOLVED] The Referenced Script On This Behaviour Is Missing

    I have a Game Object where I store a prefab and a script to use on a GUI button. Basically, you click on the button and the script instantiates a clone of the prefab (and another function that destroy such clone). The script works fine but Unity keeps giving me these error messages: The referenced script on this Behaviour (Game Object 'Capsule') is missing! The referenced script on this Behaviour (Game Object '<null>') is missing! The referenced script on this Behaviour (Game Object... [SOLVED] The Referenced Script On This Behaviour Is Missing

  • Issue#2390: Unity - Odd behaviour/behavior with inherited script

    I'm not sure what's going on but I have 3 classes. MovingObject, Character, StarPlayer, each inheriting from the previous class, respectively. In the lowest or base class, moving object, I have a jump method that sets a global variable "isgrounded" to false when it is triggered. The jump method however is virtual and overridden/bubbled up from the StarPlayer class. In the moving object class then the update method is called which reevaluates isgrounded, if isgrounded is false(so... Jumping).... Odd behaviour/behavior with inherited script

  • Issue#2465: Unity - Script: Size RawImage to Parent, keep aspect ratio.

    Here's a handy little script I came up with, so you can tell any RawImage to fill it's parent's Rect, while maintaining the aspect ratio of the src texture. It also supports %-based padding. Code (csharp):   static class Canva tensions { public static Vector2 SizeToParent(this RawImage image, float padding = 0) {         var parent = image.transform.parent.GetComponentInParent<RectTransform>();         var imageTransform = image.GetComponent<RectTransform>();         if (!parent) { return... Script: Size RawImage to Parent, keep aspect ratio.

  • Issue#2470: Unity - Random Editor issue..5.3.1.2 | seems VS 2016 is causing editor to turn all warnings into err

    It happens in all my projects, and it only happens after I open VS (double click on script), make a script change, hit save..I can fix 'one' of the errors(warnings), unity re compiles...and Editor comes back to normal..for awhile..then back to that behavior,,, This is blocking my development chi....(I could fix every single warning)... here is the thing..under 'preferences', attach to editor...I can not Turn that Off...EVER.... I unchecked it, restart unity...it is active again...(that is... Random Editor issue..5.3.1.2 | seems VS 2016 is causing editor to turn all warnings into errors..

  • Issue#2740: Unity - Ultimate Inventory System C#

    Ultimate Inventory 5​ ​Ultimate Inventory 5 is here using the powerful Unity 5 UI and it is re-written from scratch in order to maximize the new features of Unity 5 Engine. It is already submitted and waiting or approval from the Unity Asset store team. You may notice a price increment (just $5) but anyone who already owns it will get the update for free. It will be available at two versions... Ultimate Inventory System C#