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
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 ...
Rakesh's user avatar
  • 539
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 ...
Kostas's user avatar
  • 453
11 votes
3 answers
101k 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 ...
Aman Grover's user avatar
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?
pramitafirnanda's user avatar
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 : ...
Coyote's user avatar
  • 3,220
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)...
Shohanur Rahaman's user avatar
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 ...
Leggy7's user avatar
  • 1,454
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 ...
Dan Violet Sagmiller's user avatar
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 ...
Sata's user avatar
  • 444
5 votes
2 answers
13k 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 : ...
coder_86's user avatar
  • 175
5 votes
1 answer
788 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 ...
Garflington's user avatar
  • 1,055
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 ...
James Hurley's user avatar
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 ...
user3208290's user avatar
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 ...
Nasir Mahmood's user avatar
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 (...
Sudhir Kotila's user avatar
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, ...
Discipol's user avatar
  • 168
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 ...
Mihai Barbu's user avatar
4 votes
3 answers
4k 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 ...
Raminlich's user avatar
  • 128
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 ...
Marc Pilgaard's user avatar
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 ...
EOG's user avatar
  • 308
4 votes
1 answer
13k 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 ...
Akari's user avatar
  • 147
4 votes
1 answer
470 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 ...
T. Kiley's user avatar
  • 537
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 ...
Ben's user avatar
  • 141
3 votes
2 answers
377 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 ...
Juan Carlos Leon's user avatar
3 votes
2 answers
661 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. ...
user80678's user avatar
3 votes
2 answers
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. ...
MBraiN's user avatar
  • 143
3 votes
1 answer
783 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.
user avatar
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: ...
Dubstaphone's user avatar
3 votes
1 answer
9k 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 ...
Kartik Shah's user avatar
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: ...
Dan Violet Sagmiller's user avatar
3 votes
1 answer
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?
AVIK DUTTA's user avatar
3 votes
2 answers
38k 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 ...
ElPolloLoco999's user avatar
3 votes
1 answer
14k 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 ...
raisa_'s user avatar
  • 167
3 votes
1 answer
669 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 ...
poudigne's user avatar
  • 245
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 ...
Peyton Blanscet's user avatar
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 ...
Shial's user avatar
  • 141
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.....
questionasker's user avatar
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 ...
Seyed Morteza Kamali's user avatar
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 ...
Sivamurugan's user avatar
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 ...
MotoSV's user avatar
  • 141
3 votes
1 answer
529 views

Trying to get reference to Button in Javascript Unity3d

I've this simple script in Unity3d: ...
Is Software's user avatar
3 votes
1 answer
341 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 ...
frankish's user avatar
  • 271
3 votes
1 answer
843 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 ...
Aks's user avatar
  • 131
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 ...
Saurabh Passolia's user avatar
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?
Bob's user avatar
  • 127
2 votes
2 answers
13k 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 ...
gitright's user avatar
2 votes
2 answers
3k 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 ...
virtouso's user avatar
  • 2,608
2 votes
2 answers
4k 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.
sagarkothari's user avatar
2 votes
1 answer
5k 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. ...
programmer23's user avatar
2 votes
1 answer
238 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 ...
grillzeE's user avatar

1
2 3 4 5
7