Questions tagged [unityscript]

DO NOT use this tag to describe Unity scripts which are written in C#! UnityScript is a separate language and should be used only on questions explicitly using that language. UnityScript is a DEPRECATED scripting language used by the Unity game engine in versions prior to 2018.2. It is often mistakenly referred to as Javascript, but does not follow the ecmascript standards.

UnityScript was one of the scripting languages used by the prior to version 2018.2. It features classes, strict typing, and is generally developed within the framework, (similar to .Net but designed to be cross platform) among other features.

Although UnityScript is sometimes referred to as "JavaScript", it is a different language, that does not follow the standard. From the Unity3D wiki:

Though many in the Unity development community (and even in the Unity corporation) refer to UnityScript and JavaScript as if they were equivalent or interchangeable, the two are very different languages. Though they resemble each other syntactically, they have very different semantics.

The semantics of UnityScript resemble with the main difference (and really its biggest similarity to javascript) being the ability to have dynamically typed objects.

In the Unity blog "UnityScript’s long ride off into the sunset" it was announced that starting from Unity 2017.2 the ability to create a "UnityScript" has been removed from the "Create Assets" menu as one of the first steps taken to deprecating UnityScript. UnityScripts can however still be made in this version through other means.

As of Unity version 2018.2, support for UnityScript has been completely removed. A tool to convert UnityScript to C# scripts has been released by Unity to help UnityScript users transfer over to C#. More detailed information and a how-to can be found in the Unity blog "UnityScript to C# Conversion Tool"

References


Related tags

1604 questions
0
votes
2 answers

How to swap array elements?

I have an array (in a UnityScript file for Unity3D) which has checkpoints as GameObjects, and I am trying to write a function to swap them. So I have public var cps: GameObject[]; //Initializes correctly function…
marvin
  • 1,847
  • 4
  • 15
  • 20
0
votes
2 answers

Search a substring in an array of Strings in unityscript

I'm trying to search a substring in an array of Strings. I'm using the following code (in Unity3): var obstacles = ["Border", "Boundary", "BoundaryFlame"]; var frontAvailable = true; var leftAvailable = true; var rightAvailable = true; var hitFront:…
Joetjah
  • 6,292
  • 8
  • 55
  • 90
0
votes
1 answer

How to change a string into integer

I have to change a string into integer var floorname = coll.collider.gameObject.name; //output:block25 var cur = floorname.Substring(5); //output: 25 var cu = parseInt(cur); But while giving print(cu); it shows value properly. but with a…
Sona Rijesh
  • 1,041
  • 7
  • 32
  • 62
0
votes
2 answers

unityscript Closure Iterating through a Custom Class

I have a custom class called SaveData that is made up of four strings. I have an array of SaveData called loadEntries, and I want to iterate through each one and access the strings to compare them to something else. I've done a lot of reading…
Ben
  • 951
  • 12
  • 19
0
votes
1 answer

Unity unityscript Error

I have an array learnnum that looks like [0,1,1,0,1,1,1,1,0]. I need to basically ask the user for an input Left Mouse Button or Right Mouse Button. If Left, then the values of learnnum of [i] is flipped, else nothing happens. I only do this for…
gran_profaci
  • 8,087
  • 15
  • 66
  • 99
0
votes
1 answer

unityscript Function. Object does not support slicing Error

I'm writing a very simple function where I am supposed to find the distance between two 3 d points. One set of points are given directly as floats, whereas the others are given as a horizontal array. The three inputs are x,y,z which are the floats…
gran_profaci
  • 8,087
  • 15
  • 66
  • 99
0
votes
2 answers

Simple C# or unityscript coding in Unity3d. Need to remove all distinct words from a nx2 array

Sorry But I am very new to coding in Unity. I have an nx2 array as shown: var questans = new String[10, 10]; questans[0,0]="Hey How's it going?"; questans[0,1]="You know me Just chillin'"; questans[1,0]="Hello there friend"; questans[1,1]="Well met…
gran_profaci
  • 8,087
  • 15
  • 66
  • 99
0
votes
1 answer

Networking in unityscript Unity3D

what is the analog of Networkview.ismine method in unityscript? The problem is when I create server and connect to it, two players are appeared. When I try to move one of them, both players move simultaneously at the same direction. All the scripts…
Nurlan
  • 2,860
  • 19
  • 47
  • 64
0
votes
1 answer

function OnCollisionEnter() not working unity

I am using unityscript and I have no idea why but the OnCollisionEnter Function never calls, even when logging it in unity3d. Is there an alternative or a reason why this is happening? By the way I am trying to use this collision detection function…
Bob
  • 117
  • 2
  • 11
0
votes
1 answer

Why does G==G return false?

I am using the Unity Game Engine, and I have run into a problem with some of my code. function NoteDecision(n :String) { Debug.Log("-"+n+"-"); // This is returning -G- which means its just "G" Debug.Log(n=="G"); // This is returning false,…
0
votes
1 answer

Transforming several objects via OnGui in Unity 3D

I'm new to Unity and Javascript and trying to recreate the puzzle game Cryptica as a learning experience to get into the engine. I am trying to move two objects simultaneously when calling one of four OnGUI buttons: left, up, right and down. The…
0
votes
4 answers

Unity 3D Spinning a gameobject

I am trying to spin a 3D Gameobject in unity. It is actually a cylinder with just a texture of a poker chip on it. I want to spin it 360 degrees once it has collided with a raycast. It is working just fine in the Unity emulator, however, on the…
amedeiros
  • 939
  • 2
  • 15
  • 24
0
votes
1 answer

Unity3D and the iPhonekeyboard?

I'm trying to figure out how to use the iPhoneKeyboard function in Unity3D. I want to be able to run a function when a user hits the button "OK" in the keyboard. I just simply can't figure this out. The second question in this matter is how I can…
-1
votes
2 answers

Is Python similar to UnityScript, (JavaScript)?

I'm wondering if Python is similar to the way JavaScript is used with the Unity3d Game Engine? I know standard JavaScript that manipulates the DOM is very different from how Unity utilizes JS. Would knowing Python be beneficial to getting started…
Jonathan Musso
  • 1,374
  • 3
  • 21
  • 45
-1
votes
1 answer

'Not A Member of Object' Error

I think I'm beginning to like this coding stuff. Anyway in my current Shooting Gallery project I have a JavaScript question. I'm building in Unity3d and I get a "transform" is not a member of "Object" error on the code inserted below. var…
Digital D
  • 161
  • 2
  • 3
  • 17