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.
318 questions
20
votes
2
answers
7k
views
Unity Method count exceed the limit of 64K
I just got an issue related to a 64k method in Unity so that's why I'm unable to build my project. It shows method limitation exceed the limit of 64k method count. So can anyone here help me out to ...
13
votes
3
answers
12k
views
How do C# and UnityScript differ in Unity development? [closed]
Other than the obvious language differences, how do UnityScript and C# differ when developing games in Unity3D?
Is there a noticable performance difference?
Is the UnityScript code packaged as-is? If ...
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 ...
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?
7
votes
2
answers
18k
views
Retrieve the original prefab from a game object
How would one proceed to retrieve the original prefab used for instantiating an object?
In the editor these two functions work :
...
7
votes
1
answer
2k
views
Why does Unity Eventsystem lag on first touch?
Hi I am making a very simple simple platformer game for android devices. I am using Unity's event system for player movement. The problem is when I touched the button first time there is a lag (hiccup)...
6
votes
1
answer
2k
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 ...
5
votes
3
answers
6k
views
How do I define a required component on a Unity game object?
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 ...
5
votes
1
answer
13k
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 ...
5
votes
2
answers
14k
views
How to implement jump in NavMesh?
I want my NavMeshAgent to jump when Space key is hit.
The Script (in Unityscript) I tried is :
...
5
votes
1
answer
838
views
Optimizing data structure for my text adventure? [duplicate]
In my text adventure I'm making, I store the story data in a hashtable (I'm using unity's javascript/unity script since I'm more comfortable with the syntax than C#).
The problem is, the way I ...
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 ...
5
votes
3
answers
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 ...
5
votes
1
answer
2k
views
How can I copy an asset folder programatically depending upon a constant?
I have a Unity project in which I have 200 games and some 350 scenes. Now I want to make separate builds for each game. All my assets are present in ...
5
votes
1
answer
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 (...
4
votes
2
answers
8k
views
How do I get mouse x / y of the world plane in Unity?
I am trying to make a tiled landscape. The terrain itself is not made from tiles but the world has a grid which I define.
I would like to place boxes/rectangles which snap to this grid, at runtime, ...
4
votes
2
answers
1k
views
How to keep a round body rotating without rotating it's center
I want to make a game in Unity in which the Player is a sad star. I want to have the points (The "arms and legs and head") of the star to rotate like a circle but to keep it's face (which is in it's ...
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 ...
4
votes
4
answers
4k
views
Unity: Assigning a key to perform an action in the inspector
I am trying to write a simple piece of code in JavaScript where a button toggles the activation of a shield, by dragging a prefab with ...
4
votes
1
answer
1k
views
Prefab random rotation in editor
Is it possible to automacicaly random rotate pefab during placement in editor in unity 4.5.3?
I can make it autorotate in game(at start) but I want it to be visible in editor and at fixed rotation ...
4
votes
1
answer
14k
views
How to get all keys and values of the PlayerPrefs in Unity?
I'm storing player name and scores in the Unity PlayerPrefs. I'd like to list all the names and scores stored in PlayerPrefs and display a high score page:
Is it possible to display all the keys ...
4
votes
1
answer
521
views
Why do my velocity estimates have such a large margin of error
I am writing a script in unity that applies a force to the object to advance it a set distance in an environment without friction or drag, producing a cosine force curve.
However, as the target ...
4
votes
1
answer
10k
views
curve objects in unity3d to wrap around an invisible cylinder?
Is there a way to transform objects in unity3d so that they can become curved? Imagine that I wanted to create a rectangle that wraps around an invisible cylinder, or that I wanted take a sprite image ...
3
votes
2
answers
415
views
How to avoid Walls in A*
Well I had a problem with the implementation of my A* algorithm in C# for unity, and I don't realize how to prevent the diagonal movement and the cross walls, I had the next code, the print line's are ...
3
votes
2
answers
697
views
What is wrong with my Chest script?
I'm making an RPG in Unity3D and I am trying to make a script for a chest to open. So I built this script! But it doesn't work. I just want some help fixing this script.
...
3
votes
2
answers
4k
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. ...
3
votes
1
answer
806
views
Change unity physics engine speed
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.
3
votes
3
answers
5k
views
Unity Raycast shoots right through some objects
I made a melee combat system for my game. The code looks like this:
...
3
votes
1
answer
10k
views
How do I use coroutines to animate properly?
I have a coroutine, which I called from the Update() method on every click.
First, I call AddTrunk() to add to my ...
3
votes
1
answer
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:
...
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
2
answers
41k
views
How do I change the material of an object with Script in Unity?
I was making a game with Unity and I want to change an object's material using UnityScript when the player collects 5 collectables that I made. The collectables get stored in an int variable called ...
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
725
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 ...
3
votes
1
answer
2k
views
How to use sprite as font in Unity?
I've started working on my first game in Unity; It's very simple, there's a spinning block in the middle, and there are spinning blocks coming from all sides. When they hit the middle block, you lose ...
3
votes
1
answer
1k
views
Unity3d UnityWebRequest EscapeURL standard does not match Swift url encoding. How to decode it?
How should I decode escaped URL by unity in Swift?
I am developing a game with Unity3d. Something MMORPG. With server implemented by me in Swift under ...
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
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 ...
3
votes
1
answer
2k
views
Using unity app how to read the asset in android SDCard?
I am trying to read one file from my android sd card from my unity application, but its not reading.
using the asset bundle i have exported my file and kept in my android device sd card and i am ...
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
549
views
Trying to get reference to Button in Javascript Unity3d
I've this simple script in Unity3d:
...
3
votes
1
answer
373
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 ...
3
votes
1
answer
863
views
NGUI Texture Background Font of Sprite
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 ...
3
votes
1
answer
1k
views
Unity 3d 4.6b New GUI system doesn't take touch when already a touch event is occurring in 3d scene
I know this is beta version but..
I have a Canvas->Button which works fine when I tap it normally.
I have a joystick in my scene which is drawn by separate camera other than mainCamera.
now, while ...
3
votes
3
answers
5k
views
In Unity, how do I make separate mute buttons for sound-effects and music?
I'd like to have a button to mute game sounds and another to stop the game music. How can I do this?
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 ...
2
votes
2
answers
4k
views
is GameObject.Find() a bad idea even for one frame?
as I searched GameObject.Find and GameObject.FindwithTag are heavy to work with and for reall projects its better to find ...
2
votes
2
answers
5k
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.
2
votes
1
answer
6k
views
Minigame inside game in Unity
I am developing a 2D game, and using an option of the game, it will open a minigame. I planned to set it as a separate scene, but I don't know how could I load a Scene into another scene as a window.
...
2
votes
1
answer
261
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 ...