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.
22 questions
11
votes
3
answers
102k
views
Does Unity let you code in Java? [closed]
I am fairly new to Unity3D experience , but I have a very good knowledge of Java and Android development. I am really confused that if Java is at all needed for developing android applications? I read ...
1
vote
1
answer
3k
views
Unity Input.GetMouseButtonDown(0) is not working
My code to detect left mouse click is not working Input.GetMouseButtonDown(0) and Input.GetMouseButtonUp(0).
But same code for Input.GetMouseButton(0) is working.
Code:
...
2
votes
1
answer
1k
views
Distinguish touch gestures for distinct horizontal and vertical commands
In my script below I'm using horizontal and vertical swipe gesture to move the character but both gestures are called on a single touch.
...
7
votes
5
answers
6k
views
How to compress Unity apk output?
I made a game with Unity but the size of .apk file got so large, it is about 70mb...
Is there some way that I can compress my apk file?
5
votes
1
answer
10k
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 ...
4
votes
3
answers
5k
views
Update and FixedUpdate together
I know some differences between Update() and FixedUpdate() and recently I have used both functions in one script. The code is ...
3
votes
1
answer
15k
views
The value of VSync on vSync Count in Unity
In Unity, we can set the vSync value as "No sync" = 0, "Every V Blank" (60 fps) = 1 and "Every Second V Blank" (30 fps) = 2. But in the Unity Quality Setting documentation , it's written the vSync ...
3
votes
1
answer
4k
views
Import Unity Package Into Specific Folder
Everytime i do import custom unity package file, I alwasy get Messy Folder and files in root of Asset Folder.
Any Idea how to solve this ?
Many Thanks in advance.....
3
votes
1
answer
6k
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?
3
votes
1
answer
9k
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 ...
3
votes
1
answer
2k
views
How i can control button input android?
i am android programmer and i want control button input in android
for example i made a game that when you press back button in android mobile
nothing happens but i want quite from game.
This is how ...
2
votes
2
answers
14k
views
How do you reference one game object from another?
I am trying to reference a game object that was created in the editor and added to the scene (not created dynamically). How can I reference this object in a script added to another gameobject?
For ...
1
vote
1
answer
1k
views
Problem with Rotation clamping in Unity
I'm trying to get a simple cannon to rotate to point at the mouse, but I only want it to follow the mouse for 180 degrees and then stop following the mouse, and pick up again when the player re-enters ...
1
vote
2
answers
2k
views
StartCoroutine function inside TriggerOnEnter2D not working - unity + kinect
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 ...
1
vote
3
answers
4k
views
How to move a object to a target point like sine wave in 2D world
I want to move my gameobject to move point A to target point B like sine wave, I have used Vector2.Lerp but its just straight line.
so far I tried many ways and I managed this
...
1
vote
1
answer
948
views
How to circle an uneven object with Camera at a fixed distance?
Unity3d. I am trying to move an object with Camera around a fixed terrain (Mountain), while staying an set distance from its edge. I have the camera set to lookAt the mountain, and I want to circle ...
0
votes
2
answers
105
views
Character doesn't move anymore after gameover and clicked play
When my character died it displays gameover and goes back to main menu, then if I clicked play I can see my character however I can't make it move anymore. Any suggestions?
For game over:
...
0
votes
1
answer
1k
views
Can 2D Rigidbodies detect collisions with 3D Box colliders?
I would like to know if Rigidbody2D's can detect collisions with 3D Box colliders and/or normal rigidbodies.
I seem to have a ...
0
votes
1
answer
525
views
360 degree Shooting using Pythagoras problem Unity 2D C#
I have used pythagoras to give the bullet a velocity in the bullet class. Velocity is applied when Instantiated();
...
-1
votes
2
answers
182
views
how to access base UnityEngine function of object form other class
I want to know is it possible to access functions of object like Start, Update,OncollisionEnter of other objects class in another class. if the answer is yes please tell me how can i do that.
Thank ...
-1
votes
1
answer
78
views
MonoBehaviour Wouldn't Work [duplicate]
I was writing the character controller for my player character, but Unity said that there was no mono behavior script in the file I'd written the file right and I included the mono behavior ...
-2
votes
1
answer
291
views
How to keep a GameObject from dropping?
I am applying the following script to first person object:
...