Quantcast
Channel: Questions in topic: "javascipt"
Browsing all 1875 articles
Browse latest View live
↧

Calling C# methods from jslib

The function below was written in a .jslib file using a [Cross Domain Storage][1] solution. It loads a string from a remote localStorage. The problem with that function is that it writes in the buffer...

View Article


My Player health isn't working

I am making a zombie that can damage my player. I put my first script on my player, and put my second script on my enemy and after 4 days of editing it STILL DOESN'T WORK. Here's my scripts player...

View Article


Find and turn off previous camera?

I want to make some changes to my fixed camera script. it is a trigger that chooses to use the camera attached, then upon exiting the camera is deactivated. I have many cameras with these trigger...

View Article

Correct Call function On Gui ?

Problem This Script : Object.GetComponent(Score).OnGUI(); Error Console: ArgumentException: You can only call GUI functions from inside OnGUI. UnityEngine.GUIUtility.CheckOnGUI () (at...

View Article

Tower Defense game. Instance working in editor but not build.

Hello, Unity Answers. I'm working on a Tower Defense game. I've gotten to a point where I want to create a standalone build of my game. In the editor, my game runs fine. However, when I build my game,...

View Article


how can i control a float in Javascript with a UI Slider

here is my script i want to control Factor Var with a Slider from unity UI kina like a power meeter #pragma strict var factor = 100; private var startTime : float; private var startPos : Vector3;...

View Article

Can someone help me fix this coding error?

Before I show the code, I would like to explain I did try to fix it and my fix worked kind of, but caused other errors to show up and I just didn't feel like typing all of the errors out on here and I...

View Article

Rigidbody2D Move Position Not Working

I am trying to create a script that when the mouse is pressed moves a rigidbody. I have consulted the unity documentation on Rigidbody2D.MovePostion and I am still getting an error. I am wondering what...

View Article


What is causing the object to fly upwards?

Basically I just want to be able to make the object jump, but whenever I start the game, the ball ends up floating up. I believe the issue lies within either line 20 or 17, but I could very well be...

View Article


I'm trying to get the character to jump, is it because the trigger key hasn't...

This is the code I'm using #pragma strict var rotationSpeed = 100 var jumpHeight = 8; private var isFalling = false; function Update () { //Ball rotation. var rotation : float = Input.GetAxis...

View Article

Parse Array data to generate html

I have data in Array format as below... (sample one) this is an array..Based on data , I need to generate a html table by custom condition... say, table header will be day1,2,3,4,5,6 and below array...

View Article

Cool Down Time Blocks code execution

This is my first time on unity answers i have spent a long time trying to get a cool down to work, this script allows me to move a object around the room , but i don't want the player to be able to...

View Article

Basic JavaScript animation question

Hi guys- I'm a real noob (never done a Java script before) and I'm trying to work out where I made some mistakes here in getting my animation to work. Here is the code that I'm using... #pragma strict...

View Article


convert this 3 line code to c# ? i cant figure it out?

i need to convert to c form java I keep getting errors #pragma strict function Start () { } function Update(){ if (transform.position.y <-5){ GameOver(); } } function GameOver() {...

View Article

I need help with my Healthbar.

Hello everyone. So I work on a HealthBar for my game, but I dont know how I can make the script recognize the image. The rest worked normally and it changed the Scene after I got hit 3 times. The only...

View Article


Why does the audio sound different than the original ?

Hi ! i have the following code : var testClip :AudioClip; var aS :AudioSource; function Start () { // Create a new audio clip var newClip : AudioClip = AudioClip.Create("Test",testClip.samples *...

View Article

how to fix unknown identifier

var Play = false; var Developer = false; var Quit = false; function OnMouseEnter() { GetComponent.().material.color = Color.red; } function OnMouseExit() { GetComponent.().material.color = Color.white;...

View Article


Can't find any Unityscript tutorials

Iv'e been breaking my hands for the last 30 minutes googling unityscript tutorials, and seem to be having no luck finding any. Now before anyone asks, I have my own reasons for choosing...

View Article

Breaking up a string every A,B,C,D and store value behind it

I have a script that writes and reads lines from a file, consisting of A,B,C,D positions. Now as far as writing goes, I output these 4 positions every line to a file. So the format per line will be:...

View Article

how to fix menu button "play"

var play = false; var Developer = false; var Quit = false; var Camera1 : Camera; var Camera2 : Camera; var back = false; function OnMouseEnter() { GetComponent.().material.color = Color.red; } function...

View Article
Browsing all 1875 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>