42 votes
Accepted

What's the technology that allows programming inside a game?

Scripts written in scripting / embedded / interpreted languages such as "Lua", "Lisp" or "AngelScript" (more here) can be updated during the game [*] and then are interpreted (= executed) on the fly. ...
Philip Allgaier's user avatar
12 votes

What's the technology that allows programming inside a game?

Embedded language is the proper technical term. In practice, languages which are used inside other applications (such as games) are often referred to as scripting or even interpreted languages, ...
interphx's user avatar
  • 395
10 votes

What's the technology that allows programming inside a game?

You are looking for a way to change the code into some actions. This is precisely what interpreters are doing. Take a look at Python. You run it, and bam! You land in REPL(Read Eval Print Loop). You ...
MatthewRock's user avatar
5 votes
Accepted

What is the class name in Unity's AddComponent?

It's the class name of the component you want to add. For example, if you created a MonoBehaviour script named GoToPosition and wanted to add it to a game object ...
House's user avatar
  • 73.2k
5 votes

How to send an interface message?

Method 1 - Unity UI Event System Thanks to Byte56 for pointing out that there's a new approach to messaging in Unity, which is much more similar to what the asker describes in Unreal. One quick ...
DMGregory's user avatar
  • 134k
5 votes

In GameMaker, is it possible for users to code something into a game while playing, and verify that it is correct?

What you're describing is effectively running gameplay mechanics in a virtual machine, which can simplify the process of authoring them and insulate against bad behaviour. As it happens, a lot of ...
DMGregory's user avatar
  • 134k
5 votes
Accepted

Array but with a name for every element (value)

There are multiple methods to deal with this. 1) You could create an enum with custom values that you could refer to: ...
DavidC's user avatar
  • 281
5 votes

How to make Unity game moddable with scripting in a friendly way?

A somewhat blunt approach would be to let modders write C# code and then have your game read & compile those scripts, using them as though they were code the game was built with. This has some ...
DMGregory's user avatar
  • 134k
5 votes
Accepted

Best practice for giving properties to game objects

For HP, I'd recommend creating a Health component, something like this... ...
DMGregory's user avatar
  • 134k
4 votes
Accepted

Unity3D: 'Physics' does not contain a definition for 'Raycast'

I'd guess you made your own class or imported some other class named Physics. Try fully qualifying it UnityEngine.Physics.Raycast...
House's user avatar
  • 73.2k
4 votes
Accepted

Event Trigger for sprite not working

I see that the backward image is turned around 180 degrees to make it face opposite the direction of the forward image. This means that its front side is facing away from the camera. By default, this ...
Victor T.'s user avatar
  • 1,381
4 votes

Is allowing the server to remotely execute code on a client a security risk?

You might want to ask yourself if you really need client-sided scripting at all. You might be able to make many interesting mods possible by simply making your network protocol powerful enough. Most ...
Philipp's user avatar
  • 119k
4 votes

An object reference is required to access non-static member

Your nextLevelName member variable is not static, meaning there could be a different name set on each instance of the ...
DMGregory's user avatar
  • 134k
3 votes
Accepted

A python script controlling a Unity game

Ok so first follow this tutorial. Then i wrote some code to try and test it out. C# code. I used the editor example from the tutorial but you can make it run during runtime or what ever: ...
Uri Popov's user avatar
  • 3,017
3 votes

Performance Issues Using Lua in C++

I think part of the problem (which also caused me to misinterpret the question at first) is the lual_dofile() calls. This sounds like all scripts are always loaded ...
Mario's user avatar
  • 8,442
3 votes

iOS build size is too large in Unity

There is a unity guide for general optimisation on the unity website. To summarize it quickly (read the article): Reduce texture sizes (You can have specific settings Just for IOS) Compress meshes ...
user3797758's user avatar
  • 3,631
3 votes

Call a BlueprintImplementableEvent from c++ in unreal editor?

Nako Sung answer: Without game, UE4 prevents script functions to be executed accidently. (I don't know the clear reason) In C++ you can use FEditorScriptExecutionGuard: ...
Navaneeth Prathap Nair's user avatar
3 votes
Accepted

How can I change my script execution order programmatically?

You can set the order via scripts using the MonoImporter class, specifically, the method SetExecutionOrder: ...
House's user avatar
  • 73.2k
3 votes
Accepted

How can I get the assignment of an object back?

You are creating a tower prefab with Instantiate (towerPrefab, transform.position, Quaternion.identity);, but you don't do anything with the GameObject it returns. ...
Philipp's user avatar
  • 119k
3 votes
Accepted

How to get which gameobject the mouse is over in Unity?

Physics.Raycast will help you to get the gameobject using mousePosition and ScreenPointToRay ...
Muhammad Faizan Khan's user avatar
3 votes
Accepted

How do game makers (without coding) work?

You can (and you should) create scripts while using these engines (except maybe buildbox). They usually work by having a literal engine usually written in c++ running under them, and they take your ...
Bálint's user avatar
  • 14.9k
3 votes

Array but with a name for every element (value)

It sounds like you want to associate a name with an inventory slot containing a count of grenades of that type, exposed so you can edit them in the Inspector. In that case, I'd expand on Raeles's ...
DMGregory's user avatar
  • 134k
3 votes
Accepted

Camera Linecast Bumper Stuttery

I am not sure at all about the following. Instead of Linecasting between the current position of the camera and the target, I would linecast between the desired position and the target. ...
Hellium's user avatar
  • 2,949
3 votes

Visual Studio can't handle my unity scripts

Seems you don't have the Unity plug-in for VS Community. The project should open as a C# assembly project like the following. It's in tools and features, go get it. Good luck.
suvam0451's user avatar
  • 171
3 votes

User-friendly scripting when using an ECS?

ECS has its pros and cons. User-friendly scripting is not one of its pros. The problem ECS solves is the ability to have a large number of similar things in your game at the same time while ...
Evorlor's user avatar
  • 5,783
3 votes

User-friendly scripting when using an ECS?

You could create a system ScriptExecutionSystem which operates on all entities with a Script component. It obtains all components of the entity which could be useful to expose to the scripting system ...
Philipp's user avatar
  • 119k
2 votes
Accepted

Unity 5/C#/Scripting Switching Cameras

Simple method: Add two cameras to your scene, the first-person camera and the third-person camera. Attach both to the player-character. Move one on eye-height, the other further behind. Deactivate one ...
Philipp's user avatar
  • 119k
2 votes

How can I get the assignment of an object back?

With your current logic you have no choice but to run into a null reference exception. You never assign anything to tower. The check canPlaceTower is only returning ...
Skalli's user avatar
  • 229

Only top scored, non community-wiki answers of a minimum length are eligible