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
1
vote
2answers
2k views

Variable value in inspector is not updating automatically?

Something weird is happening when I change a variable value in script and hit play the var value doesn't update I have to reset the script in inspector. Is this normal? Aren't the values suppose to ...
20
votes
2answers
6k 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 ...
-1
votes
1answer
147 views

The rotation along z axis is not changing to zero? [duplicate]

Code: ...
0
votes
1answer
81 views

Player prefs is not saving data with error Namespaces cannot be used as expressions.?

code: var score:GameObject; function OnCollisionEnter(){ PlayerPrefs.SetFloat("Score",score.GetComponent(Events).i); } Events is the script I assigned to ...
-1
votes
1answer
625 views

The value of animation parameter is not changing?

Code: ...
4
votes
3answers
3k 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 ...
1
vote
0answers
506 views

I try to make a Unity Curved Shader with shadow Effect?

I try to make a curved shader with shadow effect I got a existing curved shader in github and it has no shadow effect i try to modify it but i couldn't find any appropriate solution. The shaderor ...
7
votes
1answer
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)...
0
votes
2answers
1k views

Why I have to press the button twice to deactivate the GameObject for the first time?

game engine:unity3d scripting language: unityscript code: ...
1
vote
2answers
803 views

Unity Rigidbody2d jittering movement in the y-axis

As said, rigidbody moves fine, even smoothly in the x axis. Problem comes in on the y axis. Whenever the character goes up or down, it noticeably shakes. Additional Info: Unity 5.6 Using linear ...
0
votes
1answer
64 views

How to add a volume bar like YouTube for iOS?

I am almost done with my game in Unity 5. However when the player presses Volume Up/Down, the iOS (version) shows the standard UI to show volume. Android has it's own (looks better on Stock). I want ...
1
vote
1answer
2k views

Unity Network how to move noplayer object from client side

When i drag a nonplayer object from host, client can see it, but when move the object from client, host player doesnt see any changes. How can i fix it? ...
2
votes
1answer
5k 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 ...
0
votes
0answers
104 views

Add translation at each animation cycle loop in Unity

I have a running animation. It already contains root animation. At every loop, it jumps to starting position. What is the best way to add a translation every time the animation loops?
1
vote
1answer
92 views

Game (Physics) work in Unity Editor/Remote but won't on Android?

I have a script attached to a car game object that allows the player to tap the screen and then accelerate, the game object has a RB2D and collider set to it , it works fine in Unity Remote , but when ...
-2
votes
1answer
753 views

C# syntax for “This button is interactable”?

What should be the C# syntax for the condition if (This Button is interactable)? I have a script attached to the button, Which has to run only if the button is interactable. Thank you in advance!
2
votes
1answer
3k 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. ...
1
vote
0answers
62 views

Second Animation is not working after Collision?

I want to show an accident of Character with car. so I wrote this code and in update function I wrote this... ...
0
votes
1answer
118 views

Why is my button script not working?

Okay so i'm new to C# and i made this script. The goal i have in mind is that when the player is on the button and presses a button ( W in this case ) the button is switched from on to off ( or vice ...
0
votes
1answer
56 views

Can not access GUIText in instantiated prefab

I have a prefab with the following component structure: Block Quad RawImage GUIText When ...
0
votes
1answer
99 views

Why is my enemy kill code not working? [closed]

I'm trying to make an enemy for my game, and everything works, except for the bit of code where the enemy is supposed to die. My player attacks but nothing happens. I filled in the prefabs, I have ...
0
votes
0answers
196 views

Disable global fog from camera [duplicate]

Does anyone know how to disable global fog from a particular camera? I have two cameras in my scene; one is a mini map camera, where I need to disable global fog. I have checked this answer and the ...
0
votes
1answer
722 views

Unity swapping textures not working, weird?

I made two textures for my 3D game character. I can use both of them by dragging them on my player but I want to do the same through code. I searched and found that people are either using: 1) ...
0
votes
2answers
3k views

Unity 5.3 with C# - Toggle Sound On/Off

I'm working with Unity 5.3 with C# as code editor These are what I have : I have 2 scenes in my project : home and options. I ...
0
votes
1answer
923 views

Unity - Permanent force when a rigibody without gravity hit a collider

I'm actually working on a 2D game, and stumbled upon something rather strange in Unity. The issue occurs pretty specifically, so the description will be long: In the scene, I have a flying object, ...
1
vote
1answer
357 views

C# Script file is not showing in Onclick Event in Unity 5.0.4f1?

I uploaded the levelLoader file to the gameobject. Still, when I drag the script file onClick Event, the no function is null. Why? Can anybody help me? C# code: ...
1
vote
2answers
621 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
1answer
131 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
2answers
1k 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? ...
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
2answers
28 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
65 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 ...
1
vote
1answer
919 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: ...
1
vote
1answer
78 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. ...
1
vote
0answers
998 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 ...
1
vote
3answers
3k 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 ...
0
votes
1answer
80 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
1answer
149 views

For each array within array using UnityScript

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, ...
0
votes
2answers
811 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 : ...
-1
votes
1answer
801 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
48 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. ...
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 ...
3
votes
2answers
576 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. ...
2
votes
1answer
164 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 ...
1
vote
3answers
263 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
181 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 ...
0
votes
1answer
1k 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
912 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
70 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: ...
0
votes
3answers
15k 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 2
3
4 5
7