A type of programming, often meant to be easier to learn than more "traditional" programming. Scripting is often used when performance is less important than ease of use. Examples of scripting languages are: Javascript, Lua, Perl, Python, and PHP. Scripting languages are often interpreted instead of ...

learn more… | top users | synonyms

0
votes
1answer
13 views

Audio slider doesn't change value

For some reason, my slider and audio resets back to 0 when I stop and play the game after I changed the value. Here is the code, I can't spot anything wrong with it: using UnityEngine; using ...
0
votes
1answer
22 views

How do I use playerprefs to make ui slider keep the sound settings?

I have not use playerprefs before, I want to know how to keep the change of the audio when the player change it throughout the game.
0
votes
1answer
15 views

Error BCE0043,BCE0044 and UCE001

I got my code right here: #pragma strict var hSliderValue : float = 0.0; function OnGUI(){ hSliderValue = GUI.HorizontalSlider (Rect (25, 25, 100, 30),hSliderValue, 00, 1.0); ...
-1
votes
1answer
41 views

How is the relationship between Scripts and Objects in Unity?

If I don't attach the Script to the Object, will be the code able to "see" the object? When I need to manipulate (such as enabled() or a transform()) two or more Objects, do I need to attach the ...
1
vote
1answer
27 views

Unity 5: Would Raycast suffice?

Hello game development pros! I need help with some logic in my script. I created a dynamic day/night cycle that works fine in itself, but lately I've been wanting to add a game clock that works off ...
0
votes
1answer
38 views

Unity gravity not effecting everyone like it should

so My problem is a bit weird. I have a model that will not fall at the correct speed. She falls incredibly slowly. This is the only script attached to her, and I did the "Scale to large" test by ...
4
votes
3answers
142 views

Single Switch Script vs Multiple Scripts

Would it be better to have one script that switches or have multiple scripts with each with their own function? In example, Lets say I am making a powerup script. Option 1: Create a single powerup ...
1
vote
1answer
35 views

Unable to achieve two finger panning

I'm looking to achieve a two finger smooth pan system in my project. However, the code below does not work, any interaction with the screen doesn't change to position of the camera. I am unsure where ...
-2
votes
0answers
21 views

Clamping camera and smooth pan back to target.transform?

I'm looking to have a camera move horizontally, but clamped on the other two axis. Also, I would like, during the horizontal panning, for the camera to have a short delay before smoothly fixating back ...
0
votes
1answer
30 views

Unable to stop navmeshagent for rotation before moving

I'm trying to get the NavMeshAgent to rotate before calculating a path and proceed walking. I stumbled upon a thread that said this can be done by manually rotating the object first. However, I am ...
0
votes
3answers
94 views

Health bar - calculating health bar's position from percentage

I'm making a simple health bar in Unity 3D. Health bar UI is made from images. I'm having a problem with setting bar's position based on health percentage. Here's a script part: percentHealth = ...
0
votes
2answers
27 views

Getting unit to complete rotation before moving?

I've been trying to get a unit in my project to move in a fashion similiar to that of modern MOBA games. However, I am faced with the issue of the unit moving before the rotation is completed and the ...
0
votes
1answer
17 views

Unable to get object to rotate to looked position?

I'm trying to get an object to smoothly rotate towards a clicked point in my terrain. However, my code only yields jittery movements in the other direction. Any help will be greatly appreciated. ...
1
vote
0answers
38 views

How do I add scripting logic to my dialogue tree? [closed]

I'm creating 2D RPG game and I want to implement branching dialogue system which can also change player stats, add items and so on. Also I want to implement conditions for some answers so player ...
1
vote
1answer
201 views

How do I Rigidbody.AddForce(Vector3) in Unreal Engine?

I am coming from the Unity Engine, and trying to get my feet wet with Unreal Engine 4. I want to add a one-time force to an object. To accomplish this in Unity 5, I would use: void Start(){ ...
0
votes
1answer
85 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
22 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
18 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
0answers
38 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 ...
0
votes
1answer
155 views

How do I make my character jump in every direction?

My character can only jump when he is grounded, but he can only grounded in one direction I want him to jump in every direction, can anyone help? CAN JUMP : CAN'T JUMP : Code: using ...
0
votes
2answers
101 views

A 2D Camera Follow Script That Does Not Rotate?

I am attempting to make a 2D racing game. So far I have a player car (sprite) and a main camera. I would like to know how to make the main camera follow the player car while still showing signs of ...
0
votes
2answers
155 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 ...
0
votes
1answer
105 views

Actually Implementing “C# as a scripting Language” in XNA

Following an example from this thread, I've made an application that dynamically loads in C# "scripts" (actually, plugins) into my game -- but I've hit a snag: how do I reference the assemblies for ...
1
vote
1answer
83 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
204 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 ...
2
votes
3answers
126 views

How does Unity call “update()” in the scripts?

I understand that you can expose your C++ code to a scripting language such as ChaiScript. From this you can call code that you've made in C++. In Unity, however, they have functions in the script, ...
0
votes
1answer
236 views

Unity 5: 3rd Person Controller runs by default. How to change this?

I have been working with the Third Person Controller of the Standard Assets (called Sample Assets in the beta versions) in Unity 5. When the player press the forward button, the character runs by ...
2
votes
2answers
119 views

DontDestroyOnLoad() doesn't work in Unity

I have a problem with DontDestroyOnLoad() in Unity. It does not work! My code: private static PlayerSpawningScript instance; public void Awake() { Debug.Log ("PlayerSpawningScript awake"); ...
1
vote
1answer
163 views

Instantiating prefabs dynamically in script

I have a canvas object. I right click it and add a Button, which defaults to having a rect transform, image script, button script and text child object. I make it a prefab and delete it from my ...
0
votes
1answer
63 views

Compiled vs Scripting Plugin System

I'm making a very simple game that revolves mostly around user-created mods. So far I've seen most games using Lua or something like Lua to enable user scripting, but recently I've seen people using ...
0
votes
1answer
85 views

Unity Collision Difficulties (How do I make a ground in unity with lots of pieces that doesn't have poor collision?)

So I'm working on this game that I came up with the idea for while watching the Unity Roll-a-ball tutorials. So it's probably important to note that I'm extremely new to game design and I don't have a ...
0
votes
0answers
110 views

Physics2D.OverlapCircleAll seems to be bigger than my radius

Im trying to make a "Scorched earth"-like game using unity. I managed to fire my bullet and make it explode on contact. What I am trying to do is do some damage to the tanks even if the bullet didn't ...
0
votes
0answers
164 views

Anti-Roll bar doesn't work

I'm making a racing game in Unity that has trucks as vehicles. For the truck movement, I'm using WheelColliders. After some testing, I found out that after a certain speed (~60km/h), turning made the ...
1
vote
1answer
208 views

How to write testable MonoBehaviour and test scripts in Unity?

I had problems with decoupled scripts and exposing interfaces in Unity, and these answers helped me a lot. But now, since I don't have hard-coded references in my scripts, I wanted to write unit tests ...
15
votes
6answers
2k views

How can I avoid tight script coupling in Unity?

Some time ago I started working with Unity and I still struggle with the issue of tightly coupled scripts. How can I structure my code to avoid this problem? For example: I want to have health and ...
0
votes
2answers
147 views

How do I access my existing script from a different script attached to a different gameobject?

I have my health(script) component on my player gameobject that gets boosted whenever we tap on that gameobject. However, I want to add a separate Gui texture button gameobject and tap on that to ...
1
vote
1answer
134 views

Questions about scaling in a 2d game in unity

Okay, so: I am making an android game. I want everything to scale to the size of the screen I'm using. Further, my static background needs to scale (as well as every other object), but if the aspect ...
0
votes
0answers
74 views

Google Developer Console Error message

i received my first crash report of on Google Developer Console yesterday and im completely lost. Did anyone receive this error before and how can i go about fixing it? Any help would be greatly ...
1
vote
2answers
216 views

NPC daily routines and scene loading

I'm making a basic survival RPG in Unity 3d. I'm separating my world into different scenes to save memory but I'm not sure how I'm going to program NPC daily routines. For example, if the player ...
1
vote
0answers
92 views

Scripting language for high complex educational game [closed]

I'm at a stage of working at my C++ game that I need to implement a script language to allow the players to perform tasks inside the game's logic. I'm a sole programmer and thus it's entirely ...
0
votes
0answers
77 views

How to embed UnityScript for scripting in Unity3D?

It is useful to have parts of your game being scriptable. Many people (especially outside of Unity) are using LUA for that job. As UnityScript (as with Boo or C#) is a first class citizen why not use ...
0
votes
2answers
432 views

How to reverse gravity in Unity

I'm trying to figure out how script gravity reversal on collision with an object. How can I reverse gravity?
-1
votes
4answers
167 views

Scripting vs Programming [closed]

How does using Scripting and calling functions of scripting API differ from programming using C++ in UDK or Unity?in scripting we use the scripting API to interact with the engine and use functions ...
0
votes
1answer
459 views

Random Object in Array

I am using Unity. I have created eight different types of objects, stored in an array, and I am displaying them on the scene in a grid pattern with random order. The first four objects in the array ...
0
votes
4answers
443 views

Entity Component Architecture and Scripting without using threads

I am working on a small game engine for practicing purpose and also for putting some of my ideas into action. What I have so far is a couple of systems for rendering, sound etc. The next step is to ...
3
votes
5answers
196 views

Scripting APIs and scripting to make games

I am confused, what is scripting and what is scripting API? Is scripting the process of writing the game program? And is the scripting API (as in unity scripting API) the API provided by the game ...
0
votes
0answers
71 views

How do I hook up new spell scripts in Skyrim?

I am currently using this tutorial of making a location-based magic spell in Skyrim. The spell I'm making will place a soil mound on the ground wherever the conjuration ball hits when you shoot it. ...
2
votes
1answer
998 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 JavaScript when the player collects 5 collectables that I made. The collectables get stored in an int variable called ...
1
vote
0answers
44 views

Scripting Documentation [closed]

I'm working in a game which will support scripting. I have seen that popular games supporting this feature usually ends up setting up a wiki from where one can obtain information about how to script ...
0
votes
1answer
129 views

Shared Material

I have this simple script, so the user touch one of the cubes all cubes with same material will change color. One of this cubes must have the name of the color on it, only one, so the user touch the ...