Storing and using weapons and objects
Good afternoon, I'm planning a system that I use, but I'm with some questions... I am creating a game where it will have a system to store weapons and objects, as in the main RPG's, where the user can...
View ArticleLerping outside of an Update Function
I have, for a long time now, tried using mathf.lerp outside of an update function but as of yet have never figured out how. The value simply jumps or goes half way. In the case of my current script,...
View ArticleReferencing an Animator component from a parent object?
Hi, I'm trying to reference an animator which does all the animations for a player's weapon, including: - Aiming down sights - Movement - Reloading - Firing I want to do this from a scrip attached to...
View ArticleHow to script SetTrigger (JS)?
Hi, I would like to activate a Trigger in Mecanim by pressing mouse 0. How do I script this in Javascript? I imagine it would involve: if(Input.GetButton("Fire1")) { animator.SetTrigger(I don't know...
View ArticlePong 2 players : control paddles by touch screen for PC [.js]
Hi everybody, Actually, I develop a 2 players Pong for touch screen PC (which have multitouch / window 8) and I work in Javascript. Players are face to face and deplace theirs paddles on y axis. ![alt...
View ArticleHow do I make it to go to a level after an axis has been held down after a...
I don't mind if it's C# or JS, I've been stuck on this for a while now and need help! Much appreciated Here's the code that I have written myself using UnityEngine; using System.Collections; public...
View ArticleSimple go forward and turn back loop movement stuck to the limit without reverse
I have a game object placed at the position (0, 5, 80) I want that this object ciclically moves foward (direction x in my orientation) and then when has reached a certain position turn back until has...
View ArticleNeed help coding a randomly generated track in Javascript
So I'm trying to make an endless runner type game for a university assessment, and I've run across some difficulty. I have different segments for a track (left, right, straight, etc) but I'm not...
View ArticleHelp with JS Jumping Issue
Hi Everyone I was wondering if someone could help me figure out how to stop my character from being able to jump of walls when he is at the peek of the jump? The script is simply to make my character...
View ArticleUnexpected token ")"
I have this script: var WalkSpeedModifier : float = 8; var WalkAnim : String = "Walk"; private var DefaultPos : Vector3; private var Controller : CharacterController; var PlayWhileAiming = false; var...
View ArticleJavascript Enum Question
Hey Guys, Making a simple Javascript inventory class and just have a quick question { var ItemName : String; var ItemId : Int; var ItemIcon : Texture; //the 2D image of it for inventory use basically...
View ArticleGetComponent() problems
So I am trying to get the size of my Collider, but it keeps giving me errors. #pragma strict static var CldHeadD : int[]; static var CldLeftD : int[]; static var CldRightD : int[]; static var CldFeetD...
View Articletouch is not working
in my game i have 4 scene ,one of them is may mainmenu i have some keys in this scene so i write a code that is= if (Input.touchCount > 0) { var ray = Camera.main.ScreenPointToRay...
View ArticleHow to set a target position in Vector3.MoveTowards using a variable
so i want a target position for my camera to move to be -10 away from the current x position of an object. I got this and got stuck. function moveCamera () { var myVar : double; myVar=...
View ArticleNullReferenceException: Object reference not set to an instance of an object...
here is the js: private var mn; private var CsharpScript; var oscChannel:int; function start() { mn = GetComponent("MegaNoise"); } function Update () { var n = OSCReceiver.messages[oscChannel];...
View ArticleWebGL + JSLIB Plugin, using functions
I've written a .jslib file in my /Assets/Plugins/WebGL folder that I am successfully calling back and forth with my C# code (using [DllImport ("__Internal")] in C# and SendMessage in JS). The only...
View ArticleHow to set velocity of Rigidbody without changing gravity?
I feel as if this shouldn't be happening. But when I set the velocity of my rigidbody using a Vector3 like the following code is showing, it somehow messes up the gravity and the cube object starts...
View ArticleHow can i disabel Bloom Camera Effect on Enter Trigger
Hello all and thx for reading my ask.I use Unity 5 and i have the Bloom Optimized Script on my MainCamera. At time i will disabel the ImageEffect(Bloom) when i Enter a Trigger,so here my JavaScript...
View ArticleError Message Coordinates
I have been struggling over several error messages for days, and I was wondering if the "coordinates" of the error message mean anything. I am new, so if I am saying something stupid, don't get mad....
View ArticleObject reference not set to an instance of an object
So I have this script that looks at the ground and says, "heay ground do you have Fricion?" and most of the time its all like, "You know I do dog." But some times it is like "Nope whats that." In case...
View Article