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 ...
0
votes
1answer
29 views
All scripts in Unity game can not be loaded
I can not provide a "why" here, because as far as I can tell it happened spontaneously - after saving an edit to one of my scripts, it just started happening. But here's the problem:
Every single one ...
3
votes
3answers
85 views
How to make Unity game moddable with scripting in a friendly way?
I am building a game in Unity using C# and visual studio. I want to make it possible for users to write code in some scripting (for modding purposes) without necessarily opening the source. What are ...
0
votes
1answer
27 views
Initiiating Point light animation
I have a prefab, that is essentially a point light. I want to control when an animation is initiated. I can't seem to figure out how to do that. In my scene there are 9 instances of the prefab and I ...
1
vote
1answer
36 views
Getting player cube to move left or right in relation to camera based on camera's rotation
Right now I'm trying to make the player cube move left, right, up and down in relation to the camera's rotation and position. I figured what I could do is create an empty game object, make the main ...
0
votes
1answer
76 views
Help with this enemy kill code [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 ...
4
votes
1answer
60 views
Unreal Engine 4 C++ not showing in content browser
Just to set the tone, I'm very new to game development.
I'm currently taking an online video course for Unreal Engine 4 that required me to create a C++ script. After I created the script and it ...
1
vote
2answers
87 views
Array but with a name for every element (value)
Say I have 10 different types of grenades, I would like to create one variable, to allow me to set the number of grenades given from the inspector, I could create an array with 10 integers and set the ...
0
votes
2answers
115 views
Input.GetKeyDown need to press button more than once to work
So in Unity3D I'm checking for Input.GetKeyDown(KeyCode.E) for stuff like pickups and opening doors. Sometimes it doesn't work the first time I press it and I must press the key E like 2-4 times, and ...
2
votes
1answer
114 views
Editing run time variables within a custom game engine
I want to add a feature to my game engine where I could change different variables that control in-game things while the engine is still running from a console window. Does anyone know of a way to ...
-5
votes
1answer
72 views
How can I detect when all numbers are a certain value?
I'm trying to write "you win" when all numbers are "green" (in this case, equal to the constant Fez.color.g). This is the script I have so far:
void Start () {
for (int SD = 0; SD < 10; SD++) ...
0
votes
1answer
39 views
Experiencing Multiple Issues with Code Possibly Caused By Outdated Tutorial [closed]
As somebody very new to Unity5, I was learning the first steps through a video tutorial and finally got to the coding part of everything. However, subsequent to completion of learning coding, it ...
0
votes
1answer
78 views
I am Trying to build a survival game using procedural Generation, successful in generating a Mesh, need help in Spawn and texture
I have create a Terrain using perlin-noise map, I am successful so far. But, now when i am trying to add texture, I can't figure out how. I am using using a colorMap to test, I want grass to have ...
0
votes
0answers
34 views
What are the main reasons to use scripting in games? [duplicate]
I'm trying to understand the appeal to scripting in large games.
Is it ease of development by avoiding lower level coding like C++? Thus avoiding the long compile times?
It seems scripting doesn't ...
4
votes
1answer
84 views
Unity-Sharing values between functions invoked by buttons and the rest of the script
Ok so, here is the problem.
I am doing a multiplayer 2D game using UNET.
I have a script that kind of helps a player select an avatar to play with. The avatars are listed as a scrollview of buttons. ...
0
votes
1answer
115 views
Can MoonSharp call functions from static classes?
My question is very simple. I'm using MoonSharp to add Lua scripting to my game. One use case involves calling a static artificial intelligence function from a static class I've implemented in C#. I ...
1
vote
2answers
144 views
Unity can't recognize class and namespace
I just updated Unity to 5.4 today, though as I saw, this problem was present in previous versions too.
So the error message is : "The type or namespace name 'FirstPersonController' could not be found (...
0
votes
1answer
86 views
How to make objects collisions act differently
I am making an arkanoid type game and have it mostly working. I can destroy the bricks when hit by the ball, but I am adding a twist. I want to have a object on top of the bricks that will interact ...
1
vote
1answer
42 views
Unity C# - moving objects and Debug.Log; show multiple messages only once (easy but stuck)
I have the following scenario:
a sphere is moving towards an object it can see (a cube). The cube is moving randomly through the landscape. The sphere will keep following it. I have a script that ...
1
vote
4answers
326 views
Why does the Unity manual add “Quaternion.identity” to an instantiated object?
In Unity's documentation you can find an example usage of Instantiate:
https://docs.unity3d.com/ScriptReference/Object.Instantiate.html
using UnityEngine;
public class InstantiateExample : ...
3
votes
1answer
98 views
Using a script to draw an icon next to (i.e. inline with) a text label in Unity
Suppose mystring is a string variable (whose value changes over time) and that myIcon is a texture or sprite of known dimension, say 32x32.
Is it possible to write a Unity script that draws myIcon ...
2
votes
2answers
312 views
What is the class name in Unity's AddComponent?
Unity's AddComponent() method has an optional parameter of a string. This string is the className. What is the class name? What is it used for? I could not find any documentation on this.
0
votes
1answer
37 views
Modify a character's rotation without altering it's movement
I have a character that moves around using a virtual joystick on screen (mobile game joystick) however the player doesn't face forward to the position the joystick is pointing. Whenever I modify the ...
1
vote
2answers
73 views
How can I make sure multiple player scripts all get the same amount of execution time per game tick?
I'm looking for a way to allow players to write code in a high level language, but I need to be able to keep all script instances synchronized in terms of script execution time per game tick so that ...
2
votes
3answers
80 views
Core code obfuscation and scripting
I am currently developing a 2D multiplayer game in Java and I would like to use Lua to define clientsided visual animations. Although this sounds like a reasonable idea to keep the core Java code to a ...
1
vote
0answers
19 views
Imported model from Blender stops updating after applying scripts
I am new to Unity3D and I am trying to import a model from Blender. I save the .blend file inside the assets folder and everything works well. I drag and drop my model and apply textures, colliders ...
1
vote
2answers
291 views
Performance Issues Using Lua in C++
I'm making an engine in C++ with Lua for its scripting language (using LuaBridge as the binding).
I have a lot of entities and those entities have components. One of the components on those entities ...
1
vote
2answers
140 views
Instantiating without the use of Resource Folder in Unity?
I am making a game which has around 25 prefabs. I want to generate these prefabs randomly one after another and also I am destroying the last prefab. One way is to make an array of gameobjects and ...
-1
votes
2answers
204 views
Skyrim/Papyrus: Random Actor Patrol
I saw this question and was hopeful to find the answer to my question, but no such luck:
How do I make someone walk in Skyrim?
I want to, using papyrus ONLY, make Actors that I spawn to travel/patrol ...
2
votes
1answer
69 views
Shifting values or tiles on a 2D grid (1D array)
I recently turned my practice project into a match3-type game.
The game uses a 6x10 grid, internally stored into a single array, with each item being a positive integer (0-based). I have a function ...
0
votes
0answers
19 views
Zoom in and change scenes in unity [duplicate]
I'm trying to zoom in as my game is like a map and I have to click on a certain country to zoom in and change the scene to this country. So I want to zoom the camera slowly and then change the scene ...
-2
votes
3answers
3k 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 ...
0
votes
2answers
328 views
How can I change my script execution order programmatically?
I have a script that I want to run before any other script. I want to change its execution order settings. I could do that using the Script Execution Order Settings option from within Unity, but I ...
-1
votes
1answer
94 views
Increment int in array - int i is out of scope? [closed]
This is my scenario:
I have a 3D model of a house, and an autonomously moving robot moving through the house picking up multiple objects. I have an array of 3 objects I want it to pick up, but I don'...
0
votes
1answer
42 views
Moving autonomous robot form one location to another based on array
I have a 3D model of a house, and I want an autonomous robot to move from 1 object in this house to the next one. I have it moving to the first, but it won't move to the second one. This is my code:
...
0
votes
2answers
66 views
Autonomous robot - moving from 1 object to the next object
This question falls in line with my last question: Unity 3D - create autonomous moving robot in house + first person camera movement
What I have
I have a 3D model of a house; a first-person camera ...
0
votes
1answer
71 views
How to get which gameobject the mouse is over in Unity?
So I'm working on a simple drag-n-drop based trading card game for my own amusement.
There is a card inspector included.
What I want to achieve is to change values in the inspector (which has its ...
0
votes
1answer
315 views
Unity 3D - create autonomous moving robot in house + first person camera movement
I have very, very little knowledge about programming or Unity. I have done some basic tutorials, but I want to try something harder. The thing is, I don't know where to start. If you find the time to ...
0
votes
1answer
280 views
Unity 5/C#/Scripting Switching Cameras
How can I switch cameras from First Person to Third person or from thrid person to first person. Like at GTA V you can switch the cameras. How to do this?
Tnx for your time.
0
votes
2answers
50 views
How can I get the assignment of an object back?
I have been struggling with this NullReferenceExpection error.
When I don't add anything and just use this version of the code. The game adds a tower, upgrades a tower and takes money for it.
It ...
3
votes
1answer
1k views
iOS build size is too large in Unity
I have finally completed my game and ready to upload my game to the App store, but my build size is too large.
I have checked log statement and it is roughly 13.3 mb but when i build my game and test ...
-3
votes
2answers
163 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
1answer
443 views
Call a BlueprintImplementableEvent from c++ in unreal editor?
I created a custom actor:
BPTest.h:
#include "GameFramework/Actor.h"
#include "BPTest.generated.h"
UCLASS(Blueprintable, BlueprintType)
class ABPTest : public AActor
{
GENERATED_BODY()
public: ...
2
votes
1answer
307 views
How to send an interface message?
I come from Unreal, still using it. There, how it works is like this:
Let's say you as a player have a laser gun or something, and when shooting, you use raycast to see if you've shot anything, and ...
0
votes
1answer
112 views
Do Game-Maker scripts save the variables or are they deleted after excecution?
When i make a script that excecutes at the beggining and has a var ammo and that finishes excecution, will i be able to call the var ammo in other scripts or it will be deleted? If it will not be ...
1
vote
0answers
40 views
How to change text on collision in Unreal Engine
I've just started using Unreal Engine, and I was trying to do a super simple game where there is a character that has text above his head that says 'Bag 'o' fries'. My plan was to have it so if ...
1
vote
1answer
240 views
Orion Leap Motion`Hand' does not exist in the type `Leap.Leap' - Compile error for core assets
I was playing with the example scenes provided by the Core Assets pack. Everything was working perfectly in Unity 5.3.2f1 until I opened the PinchingSandbox scene and added two script components to ...
0
votes
1answer
261 views
Unity3D: 'Physics' does not contain a definition for 'Raycast'
I'm a complete beginner in Unity 3D, and I'm following a video training. In the video the instructor uses the following code to open a door using raycast:
using UnityEngine;
using System.Collections;
...
6
votes
0answers
143 views
Design patterns for live coding/script reloading [closed]
I would like to make C++/Lua combo and write scripts for a game with live script reloading. What design patterns should I be aware of so not to cause me unnecessary pain?
For example if I have a ...
1
vote
1answer
64 views
saving script state
I'd like to ask you, since most of you have some or a lot of experience in writing games. What is your approach to running scripts and saving game state when script is executing when there is a chance ...
0
votes
1answer
45 views
Why this if logic isnot short circuiting?
I've this script in UNITY to check if the hit RayCastHid2D variable has some gameobject with hole tag or a parent gameobject with hole tag when I Raycast...
if (hit.collider != null && (hit....