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
-1
votes
1 answer

Player movement touch input

I am working on a 2D game and now I'm at the end of it! (happiness). But I can not make it move in android. What is wrong in the code below? When I run the application in UNITY console does not accuse any errors. using UnityEngine; using…
-1
votes
1 answer

Rotate gameObject by applying rotation matrix in unity3d

Is it possible to rotate a game Object by applying the Rotation matrix to it. Instead of passing each angle and rotating it. I tried to use GL.MultMatrix() but there is no movement in game Object Code sinppet: GL.PushMatrix(); …
djkpA
  • 1,224
  • 2
  • 27
  • 57
-1
votes
2 answers

How to convert code from Unity 4 To Unity 5?

I am new to installed Unity 5. I have some problem in the following code: void OnTriggerEnter(Collider other) { var air = other.collider.gameObject.GetComponent(); if(air){ air.HP += HPFill; …
Zia Ur Rehman
  • 235
  • 5
  • 16
-1
votes
1 answer

How to enable/disable cameras' effects programmatically?

I have a main camera in my scene with a Sun Shafts (Script) ImageEffect on it. [![enter image description here][1]][1] (I'm using Medieval Environment asset.) I'd like to disable this effect programmatically when main camera reaches a specific…
Fract
  • 323
  • 1
  • 6
  • 22
-1
votes
1 answer

UnityScript error in Visual Studio

So I´ve been working with unity this days for school and I have the coding for a spaceship to move only in certain space with the variables hori and vert like this: var vert: float = 0 and var hori: float = 0 but the program tells me its a…
amvd
  • 3
  • 4
-1
votes
1 answer

Making Cursor Mouse Always Enabled In Unity CardBoard Plugin

i think the title is clear , i want to make the mouse Cursor which is set in GazeInpuModule to be always enabled and in center of the both Left And Right Cameras , can anyone help me ?! ive tried changing the GazeInputModule code to place the…
-1
votes
2 answers

Slow Scene rendering at first open

My scene is rendered slowly at first open. From second times it is almost rendered immediately. I tried to remove all textures but no efect. The script is still invoked but texture is rendered after 10 seconds. I just meet this problem on iOS. I…
Linh
  • 1,024
  • 2
  • 16
  • 28
-1
votes
1 answer

Rotate an object in unity for a cardboard app

I have a car object which has to be rotated when the player head of the cardboard moves. How can I achieve that?
Sahana P
  • 73
  • 1
  • 11
-1
votes
1 answer

How to interact with NPC?

I'm about to create a point & click game where the user is supposed to interact with an NPC by clicking on it. I'm having trouble with the script though, how can I get started?
assith
  • 1
-1
votes
2 answers

"Instantiating" custom types that inherit from GameObject

I want to "Instantiate" a custom type to the scene. I made it inherit from GameObject by doing so: Block.prototype = new GameObject(); So, -will this work, will it inherit from GameObject? -And how can I "Instantiate" it? Any help is appreciated,…
Ege F
  • 107
  • 1
  • 1
  • 9
-1
votes
1 answer

Jump to another scene detecting a rigidbody

I am making a little game in c# on unity 5, and until now I have almost everything. How do I jump to another scene on detecting a rigidbody?
Fran910
  • 35
  • 5
-1
votes
2 answers

Destroy Gameobject according to distance value

I have a script that generates objects in the scene from a prefab, and I have a moveable cube. I want a script that gets the name of the object if the distance between the cube and the cloned object is < 0.3f. I have this UnityScript: var distance1…
-1
votes
2 answers

"Identifier Expected" error?

using UnityEngine; using System.Collections; public class Sword : MonoBehaviour { var totalhealth = 100; function OnTriggerEnter(other : Collider){ if(other.tag == "angelic_sword_02"){ totalhealth -= 50; } } …
-1
votes
1 answer

UNITY - Setting an object's rotation from child rotation

I am building a 3rd Person game in Unity and I have it so the Camera is attached to the head. The head rotates when my mouse moves, right now the head can do 360s while the body does not move. My objective here is to rotate the whole body(parent…
-1
votes
2 answers

OnCollisionEnter is not working:

Please Guys help, I am new to Unity and programming: I have a two Bouncing Ball, tag as BouncingBall1 and BouncingBall2, I want when a bullet hit both to destroy and if the time have not exceeded displaySecond and you have destroy the balls you win,…
1 2 3
99
100