Unityscript is one of the scripting languages available for the Unity engine (other languages are C# and Boo).

learn more… | top users | synonyms

0
votes
0answers
16 views

Character controller going down slopes

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

player isn't jumping at some rotation angle

i can't figure out why this happens. the player would not jump ad some rotation angles. this is my code for jumping: if (Physics.Raycast(transform.position,Vector3.down,1f)) { for (int ...
0
votes
1answer
19 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: ...
1
vote
1answer
75 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
3answers
55 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 ...
2
votes
1answer
56 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
100 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 ...
0
votes
0answers
33 views

Saving a c# script in a javascript variable(unityscript) [closed]

i am modifying the inventory system made by brackeys. https://www.assetstore.unity3d.com/en/#!/content/10384 Now i want to define a c# script into a variable inside the character.js file. It looks ...
0
votes
0answers
23 views

Unity - UI Mobile - Script Generated buttons/text not seen?

I'm trying to generate some buttons and text dynamically with Unity 5.0 All of my code seems proper. It looks great when I play it in the editor. Everything is generated and placed and sized as I want ...
1
vote
1answer
29 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
45 views

how to change trail renderer start width dynamically by script in unity?

I created a prefab that contain a trail renderer to make a drawing sprite in GUI, then i put it into a gameobject in a script. I want to change the start width or end width of the trail renderer ...
0
votes
1answer
73 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? using UnityEngine; using System.Collections; public class Player: MonoBehaviour { public float maxspeed = ...
0
votes
0answers
21 views

How do I make Ground Check stop rotating with the character when it rotate? [duplicate]

How do I make my character routice without Ground Check rotating with it, but still follow my character? Code: using UnityEngine; using System.Collections; public class Player: MonoBehaviour { ...
0
votes
0answers
17 views

Character fixed angle? [duplicate]

I want my character to rotate so I turn off fixed angle in Rigidbody 2D, but the problem here is that I can't jump in any other angle except for the angle where I have my groundcheck. Can anyone help? ...
0
votes
1answer
20 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:
0
votes
0answers
34 views

Character can't jump in other angle with fixed angle off

I turn off fixed angle so my character can rotate, but it can only jump in 1 angle but I want it to jump in every angle. How do I do that? Code: using UnityEngine; using System.Collections; public ...
1
vote
1answer
44 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
49 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 ...
0
votes
2answers
140 views

How do I make my character jump in any angle?

My character is a square which can spin in any angle but it can not jump in certain angle Can anyone help? using UnityEngine; using System.Collections; public class Player: MonoBehaviour { public ...
2
votes
2answers
32 views

Unity2D Sprite flips camera when moving left and right

I am using the Unity Engine and coding in C#. I have a sprite as a parent with a main camera as a child so that the main camera follows the sprite. However, when pressing 'A' and 'D' to move the ...
1
vote
2answers
97 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
1answer
69 views

How do I make my character stop going left? (Unity)

So I have this code and my character can go left, right and jump. I don't want the character going left , so how can I remove that. (I'm very new with coding) using UnityEngine; using ...
1
vote
1answer
47 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: using UnityEngine; using System.Collections; public class Player: MonoBehaviour { public ...
0
votes
0answers
24 views

Errors Generating A Plane Mesh Using A Script In Unity

In unity I have a script which is attached to a game object with a mesh filter. The purpose of the script is to generate a flat plane of 100x100 vertices. The code for the script compiles in ...
0
votes
1answer
28 views

Trying to get reference to Button in Javascript Unity3d

I've this simple script in Unity3d: #pragma strict public var topLeft : UnityEngine.UI.Button; public var topCenter : UnityEngine.UI.Button; public var topRight : UnityEngine.UI.Button; public var ...
0
votes
1answer
54 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 ...
1
vote
1answer
56 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 ...
0
votes
2answers
163 views

Unity C# 2D Platformer Enemy Patrolling

I'm setting up a basic mario-like 2D Platformer and i'm trying to give 'enemies' a patrolling path on a platform. (just like the turtles in Super Mario Bros). All they do is patroll from left to right ...
0
votes
1answer
121 views

how to Move Player on “Z” Axis 2D Movement

first im little new to unity..currently im working on 2D game mobile game.and im using Stranded Asset(Mobile) Single Joystick prefab to move Player..Currently my player move on X and Y axis. can any ...
-2
votes
1answer
36 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 ...
0
votes
2answers
43 views

unity2D Top-Dow Mobile rigibody2D

im using this code for my 2D TopDown mobile player movement.but when i move player With UI Image buttons player keep moving.it didnt stop.and also player starting of move he is very slow. the he ...
2
votes
1answer
140 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?
0
votes
0answers
13 views

I want to swap textures on button click [duplicate]

public class Textswap : MonoBehaviour { public Texture imageone; public Texture imagetwo; private Texture gametexture ; void Update (){ if(Input.GetMouseButtonDown && gametexture ...
0
votes
2answers
136 views

How to make legacy animations run in Unity in unscaled time? (Pause game related)

I'm relatively new to Unity, and I've been having a very difficult time getting the legacy animations to run in unscaled time. I need to pause my game, and as soon as it pauses, I need to have my ...
0
votes
0answers
90 views

save and view snapshot image from android device

I'm having a problem with saving image into an android device this is what i did My java class : package com.test.app; import com.unity3d.player.UnityPlayerActivity; import android.os.Bundle; ...
3
votes
1answer
91 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 ...
0
votes
0answers
114 views

front camera not working in unity 3d android

i have this peace of code : public string deviceName; WebCamTexture webCameraTexture; public Text txt; private WebCamDevice[] devices; private WebCamTexture webCam; // Use this for initialization ...
1
vote
1answer
46 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
87 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?
0
votes
3answers
95 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 ...
0
votes
1answer
214 views

Screen record in unity3d

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
0answers
48 views

how to create a responsive scene

I'm currently creating a 2d android,IOS game using unity engine ,I'm testing the game on a nexus 5,Iphone 5s device,Everything till now is working fine and i am pretty happy with the result ,but the ...
0
votes
1answer
153 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
79 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
196 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? ...
2
votes
2answers
268 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. ...
5
votes
1answer
132 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 GameObject for each action to be performed (such as movement, ...
1
vote
1answer
617 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
0answers
236 views

How to play video in Unity Free on Android (may be using external open source libraries like ffmpeg)

I need to play video file in my game and I am using Unity Free. The solution with rendering images with a certain delay is not suitable for me, because my video file is made from over than 300 images. ...
0
votes
1answer
290 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 : using UnityEngine; using System.Collections; public ...