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
21 views

Problem with Chapter 12 in Unity 4.x [on hold]

I have a problem where I'm trying to create the tic tac toe game in Unity for 4.x for chapter 12 I I'm sure I typed the code correct, but every time I run the game I place an X and then it pauses ...
1
vote
2answers
20 views

In Unity - Move a GameObject at Animator State

I want to move one of my GameObject to a different vector 3 position, when animator transit to a new state. How do I do it? Also there shouldn't be any delay.
0
votes
0answers
65 views

Shoot diagonally with Unity 2D

I'm working on a shoot script where the player can shoot right, left and to diagonal directions like right up and right down. All of this I can make, the player shooting to left, right and right up ...
-4
votes
0answers
36 views

How do I create a number table?

How do I create a number table (2*5) include 10 numbers by C# in Unity? Detail: it will include random numbers in 2*5 table it's in Unity program table instantiate as game object and every number x=5f ...
-4
votes
1answer
39 views

Explosion script. My object don't rotate

I have some problem. After explosion, my gameobject dont't rotate. Instantiate(explosion, transform.position, Quaternion.identity); GameObject changes its position, and the rotation remains old. ...
0
votes
0answers
32 views

Calculating Jumps in Unity3D

I'm currently learning Unity, and having a hard time when making a Character jump.So I can jump and move fine, but most of the time is just: Search for tutorial, understand a few things, adapt code ...
-1
votes
1answer
54 views

How to start simple game development with Unity 5 [closed]

I want to start developing games with Unity because it's easy to learn, but I don't know where to start. My questions are: - Which preparations should I make for a game? - Are there any tips and ...
0
votes
0answers
31 views

Assign a non MonoBehaviour Class to a GameObject

This is my issue: I want to assign a script that inherits from an abstract class to a GameObject. I used to create MonoBehaviour scripts like "BirdScript" or "CarScript" but I want use proper classes ...
0
votes
2answers
316 views

Unity Random.Range not repeat same position

I have this code that generates blocks in random position and it works but some times it generates blocks at the same position ,how can I fix it? var dupeobject : GameObject; function Start(){ ...
0
votes
2answers
29 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: #pragma ...
0
votes
2answers
25 views

My player died and if i clicked play in the main it will go to the last scene and say gameover [duplicate]

I am trying to make a gameover scene where in if the player is game over The game will go back to the main or start up then when I press play it will start new game however if i am game over and go ...
0
votes
2answers
53 views

Any idea to be able to make the character still continue the game until no heart left

I am newbie I am making a 2d game in unity 3d my code for the character game over is this.. I can get the heart less one heart if game over but turn back to five again I just want to decrease heart ...
0
votes
1answer
58 views

Why is perlin noise generating flat terrain in Unity?

I am trying to generate terrain using perlin noise however the terrain being generated is a plateau. Here is the code that I'm using: var xlength = 65.0; var ylength = 65.0; var scale = 4.1f; var ...
0
votes
0answers
47 views

Multiple animations with one trigger?

When the zombie character touchs this trigger, I need one more animation to play. The first animation clip would be 'run', and the second triggered animation would be to attack me. I am fairly new to ...
1
vote
1answer
39 views

Slow down in the same time over different distances

I'm trying to slow down a object over different distances in the same time, say 3 seconds. My slow down code is. function lerpSpeed (speed: float, lerpSpeedTime: float) { ...
1
vote
0answers
93 views

2D Unity: How to make a enemy jump from a navmesh platform to another?

I'm currently working on a 2d platformer, however I came across an issue where the enemy moves within a certain range of the platform. In this case I use a navmesh to limit the enemy's movement ...
0
votes
0answers
24 views

Prevent gameworld clicks working on Editor but not on device

I'm having a small problem with my game. I have a UI label to act as a pause button (with EventSystem/Trigger in canvas), but if you click it, the game reacts too, so I have the following code to ...
0
votes
3answers
95 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 //sine wave vLastPos = ...
0
votes
1answer
54 views

Building a game project in C# for Unity in VS?

Say that a project needs to be created from scratch for later use in Unity, for scripts. What is the ideal way to setup this without using a template in Visual Studio? Can this be created in C# with ...
0
votes
0answers
18 views

How to mimic Registered Spawnable Prefabs list from the Lobby Manager in a Custom Inspector

I've been trying to mimic the behavior of the Registered Spawnable Prefabs list that is used in the Lobby Manager standard script in a custom inspector, but I can't figure out how. The inspector works ...
0
votes
0answers
15 views

Unity - Are there auto-generated scripts from animations?

Is there a way to get the scripts of an animated GameObject? Are there generated scripts from working with animation in Unity? (I'm animating specific objects and was wondering if there are auto-...
0
votes
1answer
53 views

Play/Stop All Animations in a Project

I see that there's a way to get each animation clip like the following, but is there a way to get all of the animations in a given project and play/stop them at the same time? public class Anim: ...
0
votes
1answer
32 views

For each array within array using Javascript in Unity

I am trying to randomly generate some values for a character using Javascript in Unity. I have two arrays, one for colour, and one for body type. I want to get one value out of each array, randomly, ...
-1
votes
2answers
49 views

How do I pause and unpause gameobjects on is own in the scene without pressing keys in unity3d

I can't get my gameobject to pause or unpause in the scene in Unity3d. I need the game to pause for a couple of seconds maybe longer than unpause by itself. Here is my script : using ...
-1
votes
1answer
29 views

How do I make Text Mesh appear five seconds later and disappear from the scene in unity3d [duplicate]

I have a text mesh in my scene. I don't want the test to show right when the scene starts . I want to text to show up in the scene five or ten seconds later on the screen and than the text disappear ...
0
votes
1answer
19 views

FPS Android game that moves the gun as user swipes the screen

I am Making a First Person shooter game for android. Gun moves in all directions I swipe left right up or down. But the speed is so slow. How can i increase it's Speed.Here is my code. void ...
5
votes
2answers
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 ...
2
votes
3answers
121 views

Finding Object by scene loaded? (LoadSceneMode.Additive)

I learned how to Load and unload scenes in unity. using LoadSceneMode.Additive. I like to spit up my scenes as much as possible and retain the stuff I need as I go along. I'd like to be able to find ...
3
votes
2answers
141 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. #pragma strict var Text : ...
1
vote
1answer
69 views

How can I use a display as a background in unity?

I have a dancing game that I am trying to make and I have a stage where a character dances and a script to switch cameras inside that stage. What I am trying to do is set those cameras to display 2 ...
0
votes
1answer
112 views

UNITY3D How can my capsule rotate with my camera?

I'm new to 3D game development in Unity. I'm using Unity5. I've created a first person character controller that can move using WASD and I've created a crosshair along with a mouselook script. Here's ...
1
vote
3answers
98 views

How to Display hints to user when he is inactive for more than 5 sec in unity?

I have made a 2D Game using unity in which user has to select objects of similar color and now i want to display hint when user is unable to select the color for more than four seconds. I want ...
1
vote
1answer
94 views

What's wrong with my animation trigger script?

So I am making an RPG and I am setting up the player. I am trying to trigger an attack animation by pressing a button. I wrote this down and I get an error that says "Expressions in statements must ...
0
votes
1answer
97 views

my android game works very well on unity editor but not on device [closed]

Im working on a android unity project. My game works very well on the editor but, when i build it and run it on blue stacks emulator, it starts working corruptly. Bullets shoot twice in a time. When ...
1
vote
1answer
80 views

How to stack sprites?

I am currently working on a 2D game in Unity, I am using Animation Controllers / Animators for the different slots of armor on the character. The scripts set the Animation to the player object and ...
0
votes
2answers
39 views

How to use prefab only when in inventory game object?

I created an empty game object named "inventory", whenever I click on an object it transfers into that game object : and I got this far with the script: //Transforms public Transform Knife; //will ...
-2
votes
3answers
953 views

A python script controlling a Unity game

I wish to build a simple game in Unity such that the objects in the game can be controlled via a Python script (or a code in any other programming language). Is this possible? If yes then how? If no ...
1
vote
2answers
205 views

How to use touch screen for movement instead of keyboard narrow keys

I wrote this code and run the game on my desktop, now I need to build this game for android and I need to change to touch to move the player, what it should be changed in the following code and what ...
0
votes
0answers
92 views

Player character not moving

i am trying to make an fps game but my character won't move. i have tried different scripts for more than a week. Any help will be appreciated. Thanks! using UnityEngine; using System.Collections; ...
0
votes
0answers
32 views

plane bend problem

I thought to make the objects to view in the direction where the camera faces. But i have encountered a problem, When the camera goes near to the object, It bends. I don't know how to solve it. Here ...
1
vote
2answers
92 views

How can I select a object (canvas) with tag using Physics.Raycast?

I made this C# script, becase I want select a Button of the menu(canvas) for choice the dificulty of the game, but I don't want select with mouse I just want select with Aim, and I made this script ...
-3
votes
2answers
116 views

Is it possible to use Java as a scripting language in unity? [duplicate]

I wonder if its possible to use Java as a scripting language in unity to create a basic 2d game?
0
votes
2answers
83 views

How to make the wheels rotate depending on the speed of the vehicle

I want to know what the right formula is, or a way to make the wheels rotate with the speed of the vehicle? What is the standard way to make wheels look realistic and natural? Do developers use other ...
0
votes
0answers
77 views

how to simulate tank tracks(something that is around all wheels, dont know what is called)

im trying to simulate the part of tank that rotates around all wheels and i dont know what is a good way to do that. can you give me some hints to do that?
-3
votes
1answer
74 views

Why do I have to do minus-equals for the x-coordinate but plus-equals for the y-coordinate?

I found a simple script in C# in Unity5 to make the camera follow the mouse: xRotation -= Input.GetAxis ("Mouse Y") * lookSensitivity; yRotation += Input.GetAxis ("Mouse X") * lookSensitivity; ...
-3
votes
2answers
358 views

what is perfect manner to load scene and than player position.? unity 5.3

Here i have problem with scene and object position. My problem is position of object/player changed after load scene. I don`t know why this happens?. I have saved my object position with "playerprefs"....
1
vote
1answer
76 views

Unity3d Transfer of value from one script to another

Script 1 public class enemy : MonoBehaviour { private Vector3 Player; private Vector2 PlayerDirection; public float Xdif; public float Ydif; private float speed; private ...
0
votes
1answer
94 views

Unity5 - Create navmesh for a random generated environment

I am following this tutorial to create a game with random generated mazes: http://catlikecoding.com/unity/tutorials/maze/ I want to add some monsters to roam around the newly created maze. How can I ...
0
votes
2answers
59 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 ...
0
votes
2answers
125 views

timeScale=0 doesnt stop all prefabs in unity

As expected timeScale=0 can be used for stopping the game or pausing but when i make timeScale equal to 0 some prefabs still move and they can shoot bullets but addforce doesnt effect to bullets and ...