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
0
votes
1answer
400 views

How do I have different colliders against different objects? Unity

Say for example I have a ball, I want the sphere collider to be a certain radius when it comes into contact with one material (material A in diagram) and a different size when it comes into contact ...
2
votes
1answer
285 views

Smooth rotation Unity3d

I have an animation and I modified some rotations of some bones in the animation at a certain frame. What I want to do is how to make the animation in the next couple of frames interpolate smoothly so ...
0
votes
1answer
2k views

Material not changing Unity3d [duplicate]

I have a MeshRenderer mr public variable in script1. I dragged mesh1 from the assets in the <...
0
votes
1answer
4k views

Display and render only a specific object in wireframe in Unity3D

I want to know how to view and render a specific game object (mesh) in wireframe, not the whole scene. I can change the scene to wireframe using GL.wireframe but ...
1
vote
2answers
730 views

How to change the gravity with a click

How to change the gravity of a ball upward with a click Then change it again downward with another click And so on In unity
0
votes
2answers
837 views

Color submeshes in unity3d

I have a main_mesh that has 10 submeshes, I wonder how I can change the color of of these submeshes to a different color (e.g submesh1 will have a red color, ...
0
votes
1answer
438 views

Access different vertices of a Mesh Unity 3d

I have a mesh and I want to color each group of vertices with a certain color. If anyone could please advise how this can be done in Unity using coding?
2
votes
2answers
3k views

How to apply a script to multiple Objects in Unity?

In Unity, I've almost 200 or more objects. I wish to apply single script to all those objects. I'm a beginner & learning scripts in Unity. Edit: At the time of editing the scene itself.
5
votes
3answers
2k views

Character controller going down slopes

When I go down slopes with character controller, if the speed is too high, the character just flies off the slope and lands at the bottom. I want my character to "stick" to the slope rather then just ...
0
votes
1answer
122 views

Scaling of a bone is working while rotation is not Unity3d

I'm using Unity3d and I'm trying to rotate the left leg bone of an avatar but it is not working although scaling is working well. This is the code used for scaling and is working perfect: ...
2
votes
1answer
2k views

Unity: How to get a GameObject programmatically?

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 ...
0
votes
4answers
7k views

How to check distance between two different vectors?

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 ...
5
votes
1answer
8k views

Is Physics2D.BoxCast a safe alternative to a row of raycasting?

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 ...
1
vote
1answer
455 views

What would cause my script generated buttons and text to show in Unity and not on my phone?

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 ...
1
vote
2answers
472 views

player does not collide with walls unity 5

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 ...
-2
votes
1answer
2k views

How to change trail renderer start width dynamically by script in Unity?

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 ...
0
votes
1answer
881 views

How do I make the ui button to move my character? [closed]

How do I make my character move left,right and jump when click ui buttons using this code? ...
0
votes
1answer
272 views

How to write a script for circular motion?

Сan any body explain me the script for the tangential motion,so that when i cut the rope circle should move tangentially:
3
votes
1answer
7k views

Unity 3D - Rotating an object in relation to its velocity

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 ...
2
votes
1answer
203 views

Multiple enemy collidiers

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 ...
2
votes
2answers
4k views

How to move a cube withour rolling it?

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 ...
1
vote
2answers
4k views

Animator has not been initialized

My animation is working but unity keep saying that my Animator has not been initialized error Here my Code: ...
3
votes
1answer
527 views

Trying to get reference to Button in Javascript Unity3d

I've this simple script in Unity3d: ...
0
votes
1answer
4k views

How do I use rigidbody2d.AddForce to apply a force in the direction the object is facing?

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 ...
3
votes
1answer
323 views

Understanding animations of controllable characters

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 ...
-2
votes
1answer
627 views

Script to change size of a cube when pressing a button [closed]

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 ...
3
votes
1answer
5k views

How to enable IntelliSense for Unity scripts in Visual Studio?

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?
1
vote
1answer
5k views

Insert 3d text to the front face of a cube GameObject

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: ...
3
votes
1answer
599 views

Cannot use DLL in my Unity project

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 ...
1
vote
1answer
56 views

Importing code from unityscripts

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 ...
0
votes
1answer
441 views

Can Java be used for developing games for Android in Unity3D [duplicate]

I only know Java Programming Language and no other. Can I develop games for Android in Unity3D using Java?
2
votes
5answers
2k views

Checking if object passed between two other objects

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 ...
5
votes
1answer
16k views

Screen record in unity3d [closed]

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 (...
0
votes
1answer
1k views

Crop a texture procedurally

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 ...
0
votes
1answer
616 views

Visual studio and Unity does not sync

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 ...
0
votes
0answers
759 views

Adding Player Movement and Firing on Touch Input (Unity)

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? ...
3
votes
2answers
3k views

2D Boat controlling physics

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. ...
6
votes
1answer
1k views

Multiple Scripts versus single script

I have (methink) a simple question regarding attaching scripts to a GameObject. Is there any performance loss if I attach a script to a ...
0
votes
0answers
1k views

How do I fix this “java.lang.ClassNotFoundException” error?

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....
5
votes
1answer
11k views

How can I merge multiple sprite into one sprite or texture using Unity3d?

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 ...
0
votes
1answer
3k views

Play continuous music when swapping between multiple scene in Unity3d

I have the following scenario Main menu scene containing a gameobject with an audio source component An about us scene gameObject script : ...
0
votes
1answer
16k views

How to programmatically disable sprite renderer and mesh renderer in Unity3D?

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 ...
1
vote
2answers
7k views

Resetting a level in unity when exiting to main menu

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 ...
1
vote
2answers
171 views

Unity access method from separate script

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 ...
3
votes
1answer
2k views

Unity's StartCoroutine funtionality inside a .NET Library and outside a MonoBehaviour

This code is used in a MonoBehaviour script in my current code: ...
-1
votes
1answer
217 views

Float increment give wrong result [closed]

I found something weird with my unity code : ...
-1
votes
1answer
3k views

Yeild waitForSeconds(5.0) is not working

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 ...
0
votes
1answer
122 views

Why does this code not update my object's position?

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 ...
2
votes
1answer
686 views

How to initialize once for all a static field of a custom editor in unity

I have a custom editor wich has a static field. Suppose you have a static field of type MyObject: ...
0
votes
2answers
255 views

Unity3D : Unity fails to detect null objects

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 ...

1
3 4
5
6 7