Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [scripting]

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
2answers
39 views

UNITY || How to access the “exit transitions” of the current played clip from the animator?

So, I have an animator , i can access it. But from there I have no idea how to access the clips inside. I need to access the transition of the clips. I got as far as accessing the object of the "...
0
votes
1answer
80 views

Walking around a sphere in Lumberyard

I am trying to create a simple game using Amazon Lumberyard and my goal is to have levels/stages where the player will be able to walk around a mini planet. I have seen a lot of tutorials about this ...
0
votes
0answers
38 views

Unity 3d, AI walking on surface normals?

im new to ai type stuff in this. im wondering if its possible to generate a navmesh to walk on surface normals. let me explain: ive been working on faux gravity. i finally wrote my own working ...
0
votes
0answers
38 views

How to enable/disable components in a custom EditorWindow?

I'm trying to write a Unity EditorWindow tool to search for all components of a type, and enable/disable all of them at once with a check box. I'm new to Editor scripting, so I'm wondering if this is ...
-1
votes
1answer
97 views

Converting code to work in godot with sliders

I have some Fragmentarium code that I would like to convert so it will work in Godot anyone have any ideas how I can do this? The code is below: ...
0
votes
1answer
28 views

How to dynamically construct a reference to a game object by name

I have game objects tagged MenuOption0, MenuOption1, MenuOption2, etc. I want to keep a currentIndex var, which gets incremented each time the user swipes on the controller. That swipe should ...
0
votes
0answers
143 views

Unity UI panel RectTransform Position incorrect in first update

The UI Panel's RectTransform position is displaying as (0,0,0) the first time update, the second time the position is correct. What's the workaround to always getting the correct position on the first ...
0
votes
1answer
122 views

How to parent object to empty when looked at

I am making a fps in unity. I have an empty parented to the camera for the gun, and I want to be able to pick up and drop guns found in the scene. Does anyone have a simple c # script that would allow ...
0
votes
1answer
176 views

Are abilities in online games better crafted in the main game backend language or a scripting language?

Scourge Healing: Hex Spell. (30 seconds.) Whenever target foe is healed, the healer takes 15...67...80 holy damage. The above is one of Guild Wars 1's monk class skills. My question is about what ...
0
votes
1answer
143 views

Changing coordinates of the object with velocity preservation

In Doodle jump, if a player jumps over one side of the screen he appears on another side with preserved velocity and other physical parameters. I made two trigger colliders on the sides of the ...
0
votes
0answers
128 views

Creating 2D player controller in Unity

Want to create a controller of a ship for 2D space arcade. But I want it to feels like the ship has actual thrust in engines in the back. Or just that it has a tint of real physics. What is the best ...
3
votes
1answer
170 views

Redistributing sprites in procedural generation according to player movement

I am making space arcade with procedurally generated background consisted of nebulas and stars sprites, which spawn on Awake() in certain borders around player. Mobile phones have limited capacity ...
0
votes
1answer
187 views

Procedural generation background works with one type of prefab and doesn't work with another

I have background generation script with 2 arrays. One contains stars prefabs with sprites and another contains nebulas prefabs with sprites. Both have identical types of variables as generating ...
0
votes
1answer
139 views

Locking value when creating tweaking dependent values

I have several values which adjust them self In Unity Inspector when I tweak one of them. So total sum of these values stays constant. (which is 100 as 100%) Sometimes it is hard to get specific ...
0
votes
1answer
144 views

Creating dependent values in the Unity inspector

I want to create a few values which will be dependent on each other. Specifically, I want total sum of few values always be 100 In unity inspector no matter how I tweak them. E.G.: ...
0
votes
1answer
260 views

Changing texture offset in unity by script

I am trying to change texture offset in a material by a script to create a parallax effect, but it doesn't move a bit no matter what I am trying. Any tips for this case? Or am I missing something?
1
vote
1answer
46 views

NavmeshAgent not to turn back

Imagine the blue part of this picture is streets and navmesh. the red object is a car with navmeshAgent. the green circles are the colliders set as triggered and they are the destination of the car. ...
0
votes
0answers
49 views

Best way to allow players to make mods

This is a question that games, at least, seem to be differing in opinion on. Minecraft uses Java for mods and the base game. Factorio uses C++ for the base game, and Lua for the mods. Fallout 4 uses a ...
2
votes
1answer
142 views

How do I implement a JavaScript interpreter into a C# game?

I'm trying to create a hacking game where players design programs and hack other people's stuff. Users write their programs in JavaScript. I'm aiming for a hackmud-style system, where user programs ...
1
vote
1answer
42 views

Camera Linecast Bumper Stuttery

I copied a script off the internet and changed it a bit: ...
1
vote
1answer
107 views

how to control units in a game using scripts

I'm looking to create a game like screeps, in which the user controls their units using javascript. I am planning on using lua as the scripting language that controls the units in my game, as it is ...
1
vote
3answers
294 views

Binding c++ templated functions to lua

I have started using Lua as a scripting language for my game engine. It works perfectly for things like input, audio etc. However, I'm now trying to bind my entity component system functions which ...
-4
votes
1answer
536 views

How to start a Coroutine in another script?

I did some research about this but what i found was kinda confusing so I didn't actually understand it. Basically I have a coroutine that displays an image after 5 seconds, but I want that image to ...
-1
votes
1answer
663 views

An object reference is required to access non-static member

I have a code that I want to use to change levels everytime the player kills a certain amount of enemies, but it gives me this error: An object reference is required to access non-static member `...
0
votes
1answer
82 views

How do I draw two lines of text in GMS and keep one static?

I am making an intro sequence for my game, but I'm having some difficulty drawing two lines of text. The first line is "DEVELOPED BY:" referenced from a separate language file as "IntroSequence", "...
1
vote
1answer
40 views

Admob for Unity: clarification on use needed

I'm following this documentation by Google on how to integrate Admob ads into my game and I'm confused because of the following: This documentation says I build by game and then I mess around with ...
0
votes
1answer
102 views

Unity dictionaries having duplicate keys

EDIT: Restarting Unity solved the problem! ;) I don't know if Unity and GameObjects have anything to do with this, but I am getting a strange duplicate Key error while scripting in Unity. ...
0
votes
0answers
61 views

Substepping concern for collision triggers

I've read "Fix your Timestep" article by Glenn Fiedler and convienced myself I should divide timing evenly on physics part. So I have did as follows: ...
2
votes
1answer
41 views

Spawn system not working correctly

I try to spawn one or two obstacle at the same time given the position rightpos, midpos, and leftpos but i keep getting the spawn position to only rightpos and midpos. ...
2
votes
2answers
914 views

Use Python scripts in my C++ game? [closed]

So I have this game project which is going very well for now. I implemented OpenGL stuff, animations, interfaces, and a lot of very nice things that I'm glad I've finally gotten around. So now that ...
0
votes
0answers
46 views

Moving point lights decreases intensity

I'm animating a point light with the Vector3.Lerp() function. The intensity of the light decreases to zero during the animation. How can I ensure that the point light intensity doesn't decrease over ...
0
votes
1answer
49 views

Method for Modifying Numbers based on Attributes in a Game [duplicate]

A game that I'm working on in Unity has a diverse set of spells. The player character and NPCs all use an attributes which modify these spells in different ways. Our design is very fluid and the ...
0
votes
1answer
84 views

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

My game uses scripts that can be edited by the player and I'm trying to figure out how to handle multi-player, while still allowing custom scripts. What I am thinking about doing is having the server ...
0
votes
1answer
2k views

Event Trigger for sprite not working

I have set up a script to set game objects as active/inactive depending on a particular number representing the index of a gameObject array. As you can see the image below. I have two buttons as shown ...
5
votes
0answers
81 views

Scoreboard setdisplay list shows correctly per char. Can i make my sidebar show correctly per char as well?

So I've been writing a script over the last little while in Python that interacts with the Minecraft console. I'm basically trying to make a scoreboard based currency system that is world independent ...
1
vote
1answer
280 views

Instantiated objects sharing the same animator cannot animate independently?

I have two scripts and an animator. The first script is attached to an empty gameobject and creates eight plane (for use as cards). The second script runs a flipping animation if the plane/cards are ...
0
votes
1answer
476 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 ...
4
votes
3answers
3k 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 ...
1
vote
1answer
243 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 ...
1
vote
2answers
1k 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 ...
6
votes
1answer
311 views

How do game makers (without coding) work?

How do game makers/engines like Buildbox, GameSalad, Construct, GameMaker, etc work? What technologies (programming languages, APIs, etc) are used to build the and how does the program convert the ...
0
votes
2answers
2k 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 ...
0
votes
1answer
47 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
127 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
38 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 ...
5
votes
1answer
119 views

Unity-Sharing values between functions invoked by buttons and the rest of the script [closed]

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. ...
3
votes
1answer
208 views

Why are games using interpreted languages instead of compiling code into libraries and calling them at runtime?

Say I want to include a game mechanic where players are invited to code up some algorithm to control robots which would defeat the enemy and protect the tower efficiently. Most games I've seen to ...
26
votes
6answers
10k views

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

There are some games which allow the player to write/create scripts in-game, for example: Space engineers or Psi. I want to use something similar to either one, but I've had a hard time finding ...
0
votes
1answer
456 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 ...
3
votes
2answers
238 views

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

I was wondering if in GameMaker it would be possible to allow people to code a small bit of the game in so that they then unlock that move/code? Think of the game DLC Quest, in the way that you had ...