Healthbar in js
hello everyone i have PlayerStats.js i tried to find add healthbar but i found always .cs type can someone help me how can i add healthbar it basicly i know creating canvas and healthbar, background...
View ArticleRemove GUI's
i have a GUI which shows characters health i want to remove this GUI after my Character died how can i do this this is my scripts; #pragma strict var healthBar: PlayerStatsV2; function OnGUI() { if...
View ArticleObject drifting to left or right without reason
I'm making a 2D top-down shooter style game. I've gotten all the movement bits for the player down, but in it's current state after moving around for a while the player will start to drift left or...
View ArticleAdding open/close sound to a java script of a door
Hi all, I just recently figured out how to get a java script to work with my door. Now i need some help in adding the open/close sound effects. Below is the script i'm using. var smooth = 2.0; var...
View ArticleResources.Load Mesh within file
Currently, I have all my different meshes to be loaded on runtime in different c4d files. e.g. Gate1_Wire.c4d, Gate1_Base.c4d, Gate1_Door.c4d, etc ... So I use `Resources.Load("Props/" + propType + "_"...
View ArticleHow to set a BoxCollider to a variable, and disable it?
I'm stuck on something which I thought would be simple. I need to disable the BoxCollider on my projectile when it hits something. I don't want to delete it straight away, because it has a particle...
View ArticleJavascript Help
Hey guys! What i'm about to ask may sound very stupid. I am starting to make a game in unity with Javascript and i was wondering how i could find out or if i could get a link to unity's commands to...
View Articleunity webgl, angular js directive,
So I am trying to use an angularjs directive to load a unity webgl game. I have it working but on reload it bombs out, my guess is that b/c I dynamically loaded 'UnityLoader.js' and then tried to...
View Articleflashlight on and off
function Update() { if (Input.GetKeyDown("f")) { if (light.enabled == true) light.enabled = false; else light.enabled = true; } } this is my code and it said my codes are obsolete
View ArticleGet String Between Two Characters
So I'm making mods in my game and everything's fine, but the only thing is that you would have to make multiple scripts for multiple inputs because right now it only detects if it has something like...
View ArticleString Array = Anything?
Hi, I need to figure out how to get any string value in for(). For instance using int/float you can do for(var i=MINNUMBER; i
View ArticleHow do I go about creating a One-Way-Platform when using Raycasts for...
Making a 2D platformer and having trouble figuring out how to solve/create a One-Way-Platform when I am using raycasts for collusion detection. As for what a One-Way-Platform is: a platform a player...
View ArticleNeed help modifing a working java script
Hi guys, This script work great to open doors but what do I have to do to tell the below door script to open 90* up instead of 90* to the side like it is now. I would like to open a chest using a copy...
View ArticleStealth AI?
Hi, I'm working on a horror project, and have experimented with some AI i made, very crappy. I am not very good with AI so I have come to the community to ask for some pointers and some examples for a...
View ArticleRaycast needs to ignore GameObjects called Platforms. What is the best way to...
Here's a custom function I use to detect a Raycast hit. At the moment the Raycast function sees if it hit nothing or something. I need it to ignore GameObjects that are named "Platforms". I know I can...
View ArticleWWW.url ERROR:This site requires Javascript to work, please enable Javascript...
I am trying to get data from database with www.url in unity.ı have tried on localhost and it was working without any problem. ı uploaded my php files to host and ı changed links in my c# script.when ı...
View ArticleUCE0001: ';' excpected. Insert a semicolon at the end. There is a semicolon...
#pragma strict private var hasAxe : boolean = false; private var canSwing : boolean = true; private var isSwinging : boolean = false; var swingTimer : float = 0.7; private var controller :...
View ArticleHow to translate RectTransform to Transform
I am using iTween to move and ease my UI, but I cannot find a way to translate the RectTransform's position to a transform.position. Here's my example script: #pragma strict private var rt :...
View ArticleForge-like in game editor
Hey, I'm currently working on a game titled "Project Anvil" it's a SciFi FPS based in the Halo universe. It would feature gamemodes such as: Instant Action (Firefight), Arena (Matchmaking), and Anvil...
View ArticleFunction not responding to GetKeyDown
I am trying to make a first/third person game but when ever i click the key i c or any other key i set it to it doesn't respond. #pragma strict var FPScamera : Camera; var Tpcamera : Camera; private...
View Article