Skip to main content

Questions tagged [events]

Event is action that is usually happenes "outside" of main program thread, but handled inside of it.

Filter by
Sorted by
Tagged with
2 votes
2 answers
923 views

I'm trying to determine the best architectural approach for handling communication in Unity, specifically when the interaction is strictly one-to-one. The Core Design Conflict I have five crucial, ...
Curio's user avatar
  • 261
0 votes
0 answers
45 views

I'm writing a C++ game engine using SDL2 and I have an SDL event loop, but I'm not really sure what I want to do with these events. I know that I'll have systems that will be interested in these ...
steamdog's user avatar
12 votes
1 answer
1k views

I have a spell system where a the spell is a self-contained game object handling all the logic. When done, it destroys itself. This works great Then I added a second game object handling animation, ...
Zibelas's user avatar
  • 5,012
0 votes
0 answers
42 views

So in my game I'm using a message queue for everything, very similar to an event manager or event queue pattern. I've seen that lots of people use them, and they decouple when the event fires and ...
Andy Isbell's user avatar
1 vote
0 answers
43 views

I'm building a turn-based game using an event-sourced-ish architecture. Here's the basic structure: A dispatcher on the game engine receives commands from the client and routes them to command ...
nonethewiser's user avatar
0 votes
1 answer
161 views

Suppose I have these two classes ...
Wouter Vandenputte's user avatar
0 votes
1 answer
92 views

I am trying to create a system for daily events in Unity, but I am facing an obstacle where performance and memory are very sensitive for me,The DailyEvent consists of a list of DailyEventAction, ...
Ahmed Dyaa's user avatar
0 votes
1 answer
209 views

To clarify, I'm attempting to trigger an event on the entry of the player into an Area3D. This event is handled by an ...
Michael Macha's user avatar
0 votes
1 answer
92 views

I have the following public method in a MonoBehaviour attached to a game object in my scene: ...
TheLongDog's user avatar
1 vote
3 answers
105 views

A common approach to creating an interaction system is to use an IInteractable interface. The Player checks for collisions with ...
Ben's user avatar
  • 517
0 votes
1 answer
106 views

I'm trying to create an event system that can be used for all types of events that happen in my game but I'm running into this following problem. My player HUD needs to be updated whenever an enemy ...
mtg's user avatar
  • 23
0 votes
1 answer
498 views

Do I have to always remove UnityEvent listeners in OnDisable(), when I add them in OnEnable() just like I have always did with normal C# events? Does it affect the performance?
fastbyte22's user avatar
0 votes
0 answers
57 views

I use an integer field to indicate the value of the wanted year and I set a maximum and minimum limit for it and I wanted a function to be called when the wanted year value changes to display the ...
Ahmed Dyaa's user avatar
0 votes
0 answers
52 views

I'm writing a game from scratch in C++, using the book Game Coding Complete as a guide. The engine in the book has an event manager which is used to communicate between the game's systems, such as ...
Vitamin C Plus Plus's user avatar
0 votes
1 answer
294 views

So, I recently started making a small game from scratch, with no engine used(I'm a beginner at this) and I want to create an event system of my own. I want to check if my general idea for it is okay(...
HavocKid's user avatar
0 votes
1 answer
87 views

I am trying to make a dialogue system in Unity by following this tutorial: (29) 5 Minute DIALOGUE SYSTEM in UNITY Tutorial - YouTube. There is a slight twist to this and that is that I am triggering ...
Akshit Chaturvedi's user avatar
1 vote
1 answer
642 views

I am new to game development, I am practicing by creating a pong game. I currently have an Area2D set up with a signal listening for ...
zeroparity's user avatar
1 vote
0 answers
109 views

I'm building a Server-side engine for 2D sandbox game similar to Terraria or Starbound. The language I use is Dart (similar to JavaScript or C#). Currently I'm trying to figure out how to make a good ...
Zekfad's user avatar
  • 11
0 votes
1 answer
548 views

I've designed a game where, when a button is clicked, the moving point stops. If the button is clicked again, the moving point starts moving again. I only click on the button once, but the ...
Alisa's user avatar
  • 1
0 votes
1 answer
1k views

I'm working on my game engine, and was faced with the fact, that i don't know how properly design an event system. As a pattern i choose Pub/Sub with an event bus, but i don't know where i should '...
qulop's user avatar
  • 3
0 votes
1 answer
67 views

I have a UIManager meant to control the UI. The UI manager is attached to an empty game object. The Canvas has three panels, ...
Tim W Glass's user avatar
0 votes
0 answers
51 views

I'm currently implementing damage similar to these two examples, putting the damage logic inside the "call method" track of the player animation. The problem is that sometimes the game just ...
Cei's user avatar
  • 873
0 votes
0 answers
94 views

I'm attempting to create a card game as a new Unreal Dev. Currently I have a UI for the board. That UI has children for the Hands, Field, and Card Details (A window to the side of the field that has a ...
GodelComplete's user avatar
1 vote
1 answer
752 views

This is by far the biggest thing I always find myself going in circles over and can never seem to find an approach I'm happy with - setting up regular UnityEvent listeners from code vs. setting up &...
Kevin's user avatar
  • 6,976
0 votes
1 answer
47 views

My aim is to create events within my various states that will broadcast to other GameObjects when to take certain actions and to send certain data without needing to reference each GameObject. I have ...
ssnssnss's user avatar
0 votes
2 answers
2k views

If my button uses AddListener to subscribe a function to listen for clicks: mybutton.onClick.AddListener(getNameFunction); Is there a way to get the name of that ...
jasmine zhao's user avatar
0 votes
1 answer
2k views

I'm using the new UI Toolkit and new Input System together, and I've setup everything correctly the Input Actions has separate input for UI, the Input System UI Input Module is setup correctly, the ...
Džoni's user avatar
  • 36
1 vote
1 answer
3k views

The following code throws a null reference exception when I stop the project because touchInterfaceController has already been destroyed. ...
arcadeperfect's user avatar
0 votes
0 answers
127 views

I created a prefab called MapNode and have MapGenerator instantiate a bunch of them at runtime. I want to make the each instance ...
qjk's user avatar
  • 1
0 votes
0 answers
1k views

What are common ways to implement Events in an entity component system ? Most games typically have following events : Damage Events Collision Events Area of interest Events Entity Died/Respawn events ...
genaray's user avatar
  • 517
2 votes
0 answers
270 views

The Behaviour Tree Starter Kit (BTSK) on GameAI Pro suggests using a scheduler for an event driven behaviour tree. To recap: A behaviour tree (BT) is traversed fully every time the root node is ticked ...
Ralph's user avatar
  • 23
0 votes
0 answers
383 views

I am working on a game system that partly relies on static events and static instance of a class (so not Singleton or static class but just static instance of a class). I am not sure if my system will ...
Ivan's user avatar
  • 379
1 vote
0 answers
617 views

I am making a unity mobile game, I have a simple scene and a canvas with a few buttons and these buttons have scripts that detect if the button was pressed and released. Here is the code for doing ...
zmac's user avatar
  • 11
1 vote
1 answer
166 views

When detecting a keyboard key is released. What happened if the key is released at the end of the game loop, how could the pollEvent function, which is at the top of the game loop, and it is a brand ...
Đạt Phạm's user avatar
0 votes
1 answer
466 views

In the script below, "btn" is a local variable in OnEnable() method. It's said that local variable is deallocated (lost) when leaving the countaining method. Why this one (btn) is not ? Nb: ...
Achie1's user avatar
  • 181
0 votes
1 answer
199 views

I'm trying to handle mouse wheel input (aka scroll wheel) on a plain old mouse. if pyxel.btn(pyxel.MOUSE_WHEEL_Y): print(pyxel.mouse_wheel) This never triggers....
Arnaud Meuret's user avatar
0 votes
0 answers
71 views

I am aiming to create a Unity project with a code structure similar to ECS. I want the code to be consistent, easy to integrate extend and expand if multiple developers will work with it. By that I ...
user159431's user avatar
0 votes
1 answer
700 views

I am learning about Actions/Events in Unity and just built a system around them which works. However, it seems I just got lucky and I'm not sure why. Roughly, my class in a simple illustrative form (...
mike's user avatar
  • 501
0 votes
2 answers
1k views

I am working on a card game in Unity and want to implement a system where I can create card effects that happen when certain events are triggered. The events could be anything from when a card is ...
Owen Millward's user avatar
0 votes
1 answer
252 views

I am working on a coding/gaming application. I am currently stuck in the daily missions part. So, the user receives some missions each day, such as solving a problem, following another user, or ...
nour karoui's user avatar
0 votes
0 answers
165 views

I have a problem with my game_over() function in Pygame. When the player loses, the game_over() function gets executed but since ...
Salem's user avatar
  • 226
0 votes
0 answers
1k views

Let's say we have three enemies, a bear trap, a fire trap, and a minotaur. When you walk over the bear trap, the game spawns an invisible entity that, upon the player colliding with it, slows the ...
Ryan Peschel's user avatar
0 votes
1 answer
2k views

How could I intercept a save scene action being run in Unity? There is some code I would like to run in editor whenever a scene is saved. Is it possible for me to detect somehow when a scene is saved?
qqqqqqq's user avatar
  • 278
0 votes
1 answer
208 views

I'm looking for the best way to handle events for a tactic game in Unity. Every unit may need to react to different events (turn start, end, on damage to self, on damage to other, on kill, etc...). At ...
Federico's user avatar
2 votes
2 answers
2k views

In Godot IDE, what are the advantages and the caveats of using the visual IDE to connect signals to listerners instead of doing this: ...
pietrodito's user avatar
0 votes
1 answer
293 views

Broadly speaking, this is a question about how to separate my game object's code into distinct feature components that can be added and removed as needed. More specifically, I am trying to achieve ...
Ben's user avatar
  • 517
1 vote
1 answer
1k views

I am trying to make an inventory system in Unity with ScriptableObjects and a text driver that displays the contents of an inventory. So far the code looks like this: -An InventoryObject is defined as ...
IDieForShrek's user avatar
0 votes
1 answer
197 views

I am building Actionables (Windmill, Coal) on a Planet by hovering the mouse over the Planet and clicking on it. Actionables are prefabs, which have an Actionable ...
sjaustirni's user avatar
1 vote
0 answers
523 views

I am developing an game with ECS architecture and trying to design a character damage system. Does the following design fits into ECS conception and will it be extendable in future? I have an ...
Nikolai's user avatar
  • 27
0 votes
1 answer
1k views

I am transitioning to the new movement system and am having trouble figuring out how to move the camera when a mouse button is pressed and held. Here's how I did it before: ...
caleidon's user avatar
  • 591

1
2 3 4 5 6