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
12
votes
3answers
91k 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 ...
2
votes
4answers
5k views

Unity ScreenToWorldPoint always giving same coordinates with mouse position

I have a question about Unity's ScreenToWorldPoint. Whenever I use ScreenToWorldPoint(Input.mousePosition) and display the output in console this always gives me the same coordinates. MyCode: ...
2
votes
1answer
944 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. ...
6
votes
5answers
5k 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?
2
votes
2answers
10k 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 ...
0
votes
3answers
2k 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 ...
5
votes
1answer
6k 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
3k views

How do I snap the Unity camera to a 2D, tile-based map?

I have a 2D, tile-based map. I want to be able to control the number of visible tiles on the screen vertically and horizontally, regardless of resolution. I want the player to be able to move the ...
3
votes
1answer
1k 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 ...
3
votes
1answer
6k 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
3answers
2k 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 ...
2
votes
1answer
5k 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 ...
1
vote
1answer
1k 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: ...
1
vote
1answer
794 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
2answers
1k 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 ...
0
votes
2answers
57 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
1answer
858 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 ...
-1
votes
2answers
102 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 ...
-2
votes
1answer
250 views

How to keep a GameObject from dropping?

I am applying the following script to first person object: ...