Skip to main content

Questions tagged [unityscript]

STOP: this is probably not the tag you want. UnityScript is a deprecated language. For new questions about scripting in Unity, you probably want the tags "Unity" and "C#". Only use this tag for questions about legacy code written in UnityScript, the old JavaScript-like scripting language available until Unity version 2017.2.

Filter by
Sorted by
Tagged with
2 votes
1 answer
3k views

I have created a prefab. In Unity Scene editor, I dragged the prefab into the scene and named it PrefabA (this is a GameObject instance of the Prefab). Now, I need to update the PrefabA position. How ...
WenHao's user avatar
  • 123
0 votes
4 answers
9k views

So I have a very basic racing game, where I would like the car to stop once it hits the finish line. Respectively when the distance between the car and the finish line hits or goes under 0 the car ...
Ham's user avatar
  • 117
5 votes
1 answer
10k views

Raycasting in rows is a common practice. Is using the Physics 2D BoxCast function a good alternative to using multiple raycasts spread out (an example use being collision detection in a custom ...
James Hurley's user avatar
1 vote
1 answer
509 views

I am using Unity 5 and the built in GUI tools. My static GUI shows up just fine which makes me think it's not a text/font issue or some such. Again, it all looks good in the Unity editor when I hit ...
Sluggernot's user avatar
1 vote
2 answers
537 views

I just started a new proyect with a personalize first person controller, like arrow move style, it worked, but when I tryed to collide it with walls it did not happen, I tryed adding a capsule, then ...
Johan Mendez's user avatar
-1 votes
1 answer
2k views

I created a prefab that contains a trail renderer to draw a sprite in the GUI which I in a GameObject in a script. I want to change the start width or end width of the trail renderer dynamically ...
user3637362's user avatar
0 votes
1 answer
918 views

How do I make my character move left,right and jump when click ui buttons using this code? ...
Bob's user avatar
  • 127
0 votes
1 answer
336 views

Сan any body explain me the script for the tangential motion,so that when i cut the rope circle should move tangentially:
gokul's user avatar
  • 1
3 votes
1 answer
9k views

I am currently trying out Unity 3D and I've run into a problem. The problem is I have a car that moves along a road and then when it reaches a corner I would like it to turn the corner and have the ...
MotoSV's user avatar
  • 141
2 votes
1 answer
261 views

I currently have an enemy that upon collision kills the player with a kill script, I want to add another collider that acts as the visibility radius for said enemy. However, when adding another ...
grillzeE's user avatar
2 votes
2 answers
4k views

I am trying to move a cube with my keyboard on a plane surface. However, the cube always rolling instead of moving. How could I slide the cube on the plane? What I have done: I added a plane game ...
user avatar
1 vote
2 answers
4k views

My animation is working but unity keep saying that my Animator has not been initialized error Here my Code: ...
Bob's user avatar
  • 127
3 votes
1 answer
549 views

I've this simple script in Unity3d: ...
Is Software's user avatar
0 votes
1 answer
4k views

I'm trying to create a thruster on a spaceship. It should add this thrust in the direction the thruster is facing, but I am at a loss on how to get that direction and send it to AddForce. Am I even ...
Carl Kevinson's user avatar
3 votes
1 answer
373 views

I am a newbie trying to learn basics of Unity3D (5) before starting to do the real thing. Even though I tagged it as Unity3D, the logic should be the same for every kind of game engine. So I will be ...
frankish's user avatar
  • 271
-2 votes
1 answer
880 views

I am very new to coding and very bad at it. In my environnement there is a table, and i would like, after pressing a keyboard button, to make a cube appear. Then, by pressing another button, i would ...
kel's user avatar
  • 7
3 votes
1 answer
6k views

I am using Visual Studio 2013 pro and Unity 4.6. Whenever I write scripts (javascript or c#) for anything and open it up in Visual Studio, I don't get IntelliSense. How to fix this issue?
AVIK DUTTA's user avatar
1 vote
1 answer
7k views

I want to add a text to a cube in Unity. I have a cube which has a 3d text as a child. I am using the below UnityScript to write on the 3d text: ...
Dchris's user avatar
  • 119
3 votes
1 answer
725 views

I'm pretty new in Unity and i'm trying to write reusable code to use across multiple "project". So I wrote this class to POST and GET highscore via WebRequest. I compiled the project to a DLL and ...
poudigne's user avatar
  • 245
1 vote
1 answer
82 views

To encourage code reuse- i want to import methods and classes defined in my core unityscripts to be imported into other unityscripts. How do i go about this? Note: An answer here seems too ...
erbdex's user avatar
  • 125
0 votes
1 answer
482 views

I only know Java Programming Language and no other. Can I develop games for Android in Unity3D using Java?
Hammad Nasir's user avatar
2 votes
5 answers
3k views

I have a three objects (strikers), lets say red, green and blue. When I apply force to the green object I want to check if it has passed between red and blue or not. See the image below for an ...
Hardik Nadiyapara's user avatar
5 votes
1 answer
16k views

How to do screen record in unity? I want to record my screen(gameplay) during my running game. That should be play/stop , replay , save that recording on locally from device, open/load from my device (...
Sudhir Kotila's user avatar
0 votes
1 answer
1k views

Is there a way to crop a texture having a list of triangles which represent the part to be kept? For instance, I have a rectangular texture and I want to obtain a texture shaped by the triangle list I ...
Leggy7's user avatar
  • 1,464
0 votes
1 answer
761 views

I'm pretty new to Game Development world. I'm using Unity 3D (4.6 - Latest version I think) and Visual Studio to code the script and something when I edit the script un VS 2013 and go back to Unity ...
poudigne's user avatar
  • 245
0 votes
0 answers
786 views

I am having many problems with this. I am a new game developer and I am using a Unity tutorial. But I want to add touch input for movement and a touch button for firing the weapon. How can I do this? ...
pancodemakes's user avatar
3 votes
2 answers
4k views

I'm working on a top-down 2D boat game with Unity3D. I couldn't able to understand how to implement physics of rudder controlling. My physics knowledge is not enough to think how rudder dynamics work. ...
MBraiN's user avatar
  • 143
6 votes
1 answer
2k views

I have (methink) a simple question regarding attaching scripts to a GameObject. Is there any performance loss if I attach a script to a ...
Leggy7's user avatar
  • 1,464
0 votes
0 answers
1k views

I received my first crash report via the Google Developer Console, yesterday, and I'm completely lost. This is my error message: java.lang.ClassNotFoundException: Didn't find class "com.unity3d....
JDolleyArt's user avatar
5 votes
1 answer
13k views

I have an avatar generator where someone can create a custom avatar with layers superimposed. And in order to reuse this image multiple times, i want to merge all layers in one image. Is there any way ...
Sata's user avatar
  • 444
2 votes
1 answer
31k views

In my game, I have an empty GameObject that has a sprite and a TextMesh as child. I want to access the child (sprite and the ...
Mubir's user avatar
  • 39
1 vote
2 answers
7k views

I have a pause screen in my game having two buttons : resume game and exit to main menu The main menu have only 1 button wish is ...
Sora's user avatar
  • 89
1 vote
2 answers
224 views

I'm learning Unity3D and I'm practising accessing game object scripts from other objects. For the most part I've got it down, but I've run into a weird issue causing a NullPointerException. I've set ...
NoGall's user avatar
  • 111
3 votes
1 answer
2k views

This code is used in a MonoBehaviour script in my current code: ...
Dan Violet Sagmiller's user avatar
-1 votes
1 answer
289 views

I found something weird with my unity code : ...
Baddger's user avatar
-1 votes
1 answer
3k views

I am trying to call another function continuously from my Update() function. So, I have used yield WaitForSeconds(5.0); but, the it stops for the first 5 seconds and it does not stop the next time it ...
O_o's user avatar
  • 111
0 votes
1 answer
158 views

I am trying to move the object in my frame in Time.deltaTime. I have not taken care the speed yet but the problem is, the object is almost at position (0,0) after ...
O_o's user avatar
  • 111
2 votes
1 answer
886 views

I have a custom editor wich has a static field. Suppose you have a static field of type MyObject: ...
optimusfrenk's user avatar
0 votes
2 answers
291 views

im instantiating an object which is gonna play the background music for my game. On the Awake() function I check if there is a gameobject with the tag "MusicPlayer" on it, and if there isn't any I ...
Ssiro's user avatar
  • 85
3 votes
3 answers
5k views

I made a melee combat system for my game. The code looks like this: ...
Dubstaphone's user avatar
0 votes
1 answer
64 views

im trying to destroy a single game object using the following script but it destroys all of them , not the ones I want. I want to destroy the ones that the transform that holds this script collides ...
Ssiro's user avatar
  • 85
3 votes
1 answer
806 views

Is there a simple way to change the speed* of unity's physics engine like in the game SuperHot? Any script language is ok but javascript is preferred. *I am not sure if speed is the correct term.
user avatar
0 votes
1 answer
142 views

I'm new to programming and I found an animation script that has code that is called in the OnMouseDown event, when the user clicks the object. I'd like the code to ...
user avatar
5 votes
3 answers
6k views

I have a script that expected the game object to have a Terrain component. Is there an attribute I can add (or some other way) which will prevent a designer from ...
Dan Violet Sagmiller's user avatar
0 votes
1 answer
1k views

There is a simple way to increase the rotation described by a quaternion by a percentage X? Sorry, but in the documentation of Unity3D I found nothing and I have a poor knowledge on the topic.
optimusfrenk's user avatar
1 vote
2 answers
2k views

So i'm using Kinect with unity to track user's hand movements, and let the user's hand act as a mouse, I have written the code to detect a collision between a button (sprite object) and the hand ...
Sweta Dwivedi's user avatar
3 votes
1 answer
864 views

I am new to Game Development and using NGUI plugin free version. There are few sprite images in my game. I made them prefab and instantiated at runtime. then I created NGUI Texture and Made it ...
Aks's user avatar
  • 131
-1 votes
1 answer
220 views

I am new in Unity Game Development. I am designing infinite game using C# scripting. There are many cubes in my game scene. if single cube is hit by player, He gets 100 points. if same color, two ...
user avatar
0 votes
1 answer
923 views

I want to write a simple Unity script to be notified when a game object is moved, during the creation of the scene. More precisly, I want to write a Unity script that can recognize when the user ...
optimusfrenk's user avatar
-1 votes
2 answers
7k views

I am having trouble understanding raycast hits in Unity3D. I am trying to create an FPS game, so I have a gun, bullets and so on. My script for the bullets is: ...
LadIQe's user avatar
  • 103

1
3 4
5
6 7