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 compiled, and thus they can be executed directly without generating machine code.

Filter by
Sorted by
Tagged with
1
vote
0answers
11 views

Sprites do not refresh/reimport with ScriptedImporter using the SpriteEditor

I've created an importer for Aseprite-Files with the ScriptedImporter classes. I'm working on supporting the latest features of Unity like the secondary texture and this should work without bigger ...
0
votes
0answers
34 views

Snake tail in Snake game not working properly

I am making a simple snake game in Unity 2D. And the snake tail isn't following right behind the snake head like it is meant to. This is what is happening: https://imgur.com/a/zG6hbd7 This is my ...
0
votes
0answers
9 views

Only initiate pathfinding when player is near [duplicate]

So I have made a code that allows pathfinding, with the help of astar. I followed brackeys tutorial on creating a pathfinding code, and manually (without the help of brackeys) added a code to only ...
0
votes
0answers
28 views

How to assign xNode graphs to an active object?

I am trying to create a basic AI using the xNode visual scripting tool. The getting started guide from github is not showing how to assign the created graphs to an active object (if this is even how ...
0
votes
1answer
42 views

In unity C#, why use the .SetBool(booleanname, boolean) command when you could just write 'booleanname = true'?

I noticed on a tutorial for unity someone used the code: private Animator animator; private bool isRunning = false; While further on, did: ...
0
votes
0answers
18 views

How to move an object while the animation is going on?

I added a jump animation with the character in unity and to move the character I have some code like this: ...
0
votes
0answers
113 views

How to support JS/Python scripting a C++ game engine?

I'm currently writing an Entity/Component/System architecture game engine in C++, and I have the beginnings of a lua scripting system in place, which seems to be quite popular, but I feel Javascript ...
0
votes
2answers
35 views

Disabling RigidBody component

I'm trying to create a mechanic in my puzzle game in which if the player clicks on one of the flying game objects, the object's gravity would be enabled and world physics would be applied to it. ...
2
votes
1answer
70 views

Unity Jumping bug

I'm working on a basic movement system for the player in a 3D Box platformer and for a month I've been having problems with the double jump system. The one bug that I still can't figure out is ...
1
vote
1answer
47 views

Saving precomputed data about game objects in Unity3D

In my Unity3D game I have blocks of the environment that are placed by script into the scene. Each block has some bezier paths created with this asset. I can access all points of the paths when I ...
1
vote
1answer
105 views

Updating transform position after root motion

I have an animation of a character climbing with root motion in it (i.e. the character moves generally upwards for a couple of units during the animation). It is intended as a one shot, not a loop. ...
0
votes
1answer
172 views

Why does changing Texture of Particle System using Material Property Block changes texture, but Particle System is still emitting old texture?

I try the code in Start, checking in Editor shows new texture, but Particle System still emits old texture. The script works for SpriteRenderer, but not ParticleSystem. I tried to Play/Stop emission - ...
0
votes
0answers
53 views

Why do these textures tile rather than just overlap?

It might help to provide all the details, so here is the YouTube tutorial which sparked my question. There's a prefab of the background tile called "Tile Background." This prefab has the default ...
8
votes
3answers
257 views

User-friendly scripting when using an ECS?

I am currently creating a small hobby project to get back into game development, and I have decided to structure my entities using an ECS (Entity Component System). This implementation of an ECS is ...
0
votes
2answers
81 views

How to make extendable Mario warp pipe in Unity?

I want to make a warp pipe from the Mario games in Unity. The key feature of this object will be that I can set the length (height) of its "neck" to any length I require, as long as it is greater than ...
0
votes
0answers
25 views

Unity - referencing the player's renderer

I have a bit of a problem with transferring my Game/Health Manager across scenes. My current Health Manager is set up so when the player gets hit, they flash, which is controlled by activating and de-...
0
votes
0answers
78 views

Godot: Using an argument's methods as kwarg

I downloaded and tried out the Rakugo addon out of the box and I ran into this problem: 'Parser Error: Identifier 'node' is not declared in current scope' If you look you can see that node is an ...
-1
votes
2answers
319 views

Sebastian Lague's A* star pathfinding “On condition”

As the title suggests I have been following the wonderful series of tutorials dealing with pathfinding made by Sebastian Lague. My problem is that the code is meant to be working immediately after ...
0
votes
0answers
20 views

Changing controls in a new scene

I currently have a 2.5D platformer in the works for a college project, and the character can be moved with left and right. However, when entering a particular new scene, I want the character/player to ...
0
votes
2answers
84 views

How to detect whether a transform has rotated left or right

I have a game object in my scene, and I want to know how can I calculate whether this game object rotating to the right or to the left. For example : ...
0
votes
1answer
39 views

Text on touch in Algodoo

I have just started off in Algodoo and have only a basic knowledge of how it works. I want to be able to create something that when it is touched by a ball with an English flag on, it shows England ...
1
vote
1answer
91 views

Best C# technique to pass variable from Instantiated object to GameObject

There are lots of instantiated prefabs. Info from it is transmitted while it crosses a trigger zone. Some of these are calculated custom variables. I can print the custom variables from the ...
0
votes
2answers
455 views

Adding a dodge roll. Unity

I'm a newbie here. I need to add a second collider in CharacterController in the separate script with possibility to enabling/disabling them. I tried to find answer how to do it but I find nothing. ...
0
votes
1answer
190 views

Resize game object using single drag handle using Unity

Really need your help. I'm trying to create a custom controller for my app to allow users to resize and rotate game objects using a single drag object. I was able to create the code to create the ...
0
votes
1answer
77 views

Visual Studio can't handle my unity scripts

I have created a new project in Unity 2018.3.4f1 with Visual Studio Community 2017. I can't edit scripts properly in Visual Studio because of a bunch of errors related to .net framework. How can I fix ...
0
votes
1answer
1k views

Name doesn't exist in current context in Unity

I'm currently making a collectible heart in unity, the kind that updates your health bar when you collide with it, and I made two scripts: This one is called 'healthmonitor': ...
-1
votes
2answers
644 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 "...
-1
votes
1answer
190 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
32 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
1answer
123 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 ...
2
votes
1answer
211 views

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

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
145 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 ...
2
votes
1answer
191 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
214 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
161 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
168 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
921 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
139 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. ...
2
votes
1answer
208 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
86 views

Camera Linecast Bumper Stuttery

I copied a script off the internet and changed it a bit: ...
1
vote
1answer
127 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
579 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 ...
-2
votes
1answer
2k 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
1k 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
176 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
62 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
299 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. ...
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
2k 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
1answer
55 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 ...

1
2 3 4 5