Questions tagged [events]
Event is action that is usually happenes "outside" of main program thread, but handled inside of it.
245
questions
0
votes
0answers
17 views
Pygame unaccurate key press event handling
I have a problem with my game_over() function in Pygame.
When the player loses, the game_over() function gets executed but since ...
0
votes
0answers
51 views
How to handle various collision effects within an Entity Component System?
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 ...
0
votes
1answer
26 views
How could I intercept a save scene action being run in Unity?
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?
0
votes
1answer
68 views
Best way to handle events for a turn base game?
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 ...
1
vote
2answers
141 views
Is it better to connect signals in source code or with the IDE feature?
In Godot IDE, what are the advantages and the caveats of using the visual IDE to connect signals to listerners instead of doing this:
...
0
votes
1answer
10 views
C# Events in Unity to separate GameObject features into Components
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 ...
1
vote
1answer
50 views
Method subscribed to an event is called twice for every time the event is raised
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 ...
0
votes
1answer
40 views
How to make a script on a prefab act on a particular scene instance?
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 ...
0
votes
0answers
43 views
How to design a character damage system with ECS architecture?
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 ...
0
votes
1answer
66 views
Press and hold camera movement with mouse in new Input System?
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:
...
2
votes
1answer
881 views
How to correctly implement custom tick system?
I am making a custom tick system to suit my needs (calling normal ticks every 0.2 seconds, medium ticks every 5 seconds etc...)
I followed the tutorial in this video: CodeMonkey tick system tutorial
...
0
votes
1answer
62 views
How to draw unity gizmos with new input system?
I am using the new Unity Input system for my game.
When I press a key, for example "Q", I want gizmos to be drawn.
However, I can't subscribe to a keypress event with a Gizmo drawing ...
1
vote
1answer
287 views
How to see which mouse button was pressed (Unity Input System)
I have switched my game to use the new Unity Input System, and I want to know which mouse button was pressed when an action is called.
Here's how it's set up:
Whenever one of these three mouse ...
1
vote
0answers
52 views
Unity InputSystem using Unity Events not maintaining values
I am testing out using the new Input System and cannot get the values from context.ReadValue<Vector2>() to pass into a private variable.
The simple setup is ...
0
votes
1answer
93 views
How to make an application architecture a global strategy game?
I am doing a global libgdx strategy, how can I properly design the architecture?
So far, I'm in some kind of chaos, because there are different events that need to be shown to the player in the form ...
0
votes
1answer
34 views
Should UI systems update naively with events and data from outside, or should they be coupled to some game state/singleton to know to change itself?
I'm making a game in Unity for my game dev course in uni. I hope the question isn't too confusing but I have bolded sort of like a TLDR at the bottom.
My level currently has a pregame UI panel, to set ...
0
votes
0answers
47 views
0
votes
0answers
29 views
Unity Event Register / Deregister and Scene Unload
From what I understand in C#, normally when you register an event, it maintains a reference to the object of the containing method, so in order for garbage collection to pick up an object, you need to ...
0
votes
1answer
111 views
How would I go about adding a tooltip to a Unity UI Image?
I'm going to try out the community here once more, I haven't had very good look in the past with getting help.
I'm iterating through a series of List() and I'm creating a bar graph and a line graph ...
0
votes
1answer
270 views
OnMouse Events stop working when multiple cameras are active
I'm working on 2019.4.9f1 on a 2D project using Universal Rendering Pipeline. The camera settings changed so I'm stating it.
I wrote a OnMouseEnter and ...
1
vote
2answers
47 views
Improving FPS by disabling unity events
I am trying to improve the fps and in my scene there are 4322 scripts attached to 4322 objects. When I activate those objects the fps go down. Right now it's around 100fps when i active those objects ...
2
votes
1answer
84 views
Polling events with SDL results in stuttering response when dealing with multiple objects
I'm new to SDL programming and I'm not quite sure I got how it handles events.
Given an instance like this defined in "game.c":
...
2
votes
3answers
105 views
Multiple events based on in-game timer?
I've been thinking about how Zelda: Majora's Mask manages all its character events during the day and thinking about the best way to implement this. Initially I thought of each character entity ...
1
vote
1answer
75 views
Is it useful to distinguish between two different kinds of events?
i have thought about this for a long time and i think i just going in circles. I need someone to tell me if im just simply overthinking it.
So, first of all im coming from a 'classical' ECS approach: ...
0
votes
1answer
186 views
How to get the fingerID (Touch) that is pressing a specific UI button. (Unity)
I want to displace a button along with the screen position that is pressing on it.
However, having multiple touches at the same time results in wanky behaviour.
So I want to limit the button's ...
0
votes
1answer
420 views
Why can't this event call its parent event?
It's me... Back again... with another Unreal problem...
I have an Event in my Parent Class called ...
0
votes
0answers
21 views
Why can't CreateEvent be used as a value in a blueprint Map?
I need to map Button to Event, seeing as Unreal does not allow me to call premade events (in this situation, ...
0
votes
1answer
29 views
How can I prevent a component from handling collision events?
In Unity, I can set the enabled flag of a component to false, and this prevents Unity from running the ...
0
votes
1answer
174 views
Centralized event system using dictionary
I'm trying to make a centralized event system for my unity game - a central hub where other parts of the game can register/broadcast their own types of events. This means I have a singleton ...
1
vote
1answer
76 views
Moving Rect with KEYDOWN
I tried to move my obstacle with the event type KEYDOWN, but it seems it is not working.
This is my code.
...
0
votes
0answers
173 views
Unity: How to subscribe for events for easy unit testing?
I've run into the same problem multiple times that is begging for a solution. I try to write a lot of decoupled code to make my MonoBehaviour scripts as reusable as possible. This means that I end up ...
0
votes
1answer
377 views
Building a flexible GLFW Event handling system (for beginners)
The 2017 Thread "How to improve my input handling in GLFW?" is brilliant! Exactly my question and what seems like some great solutions.
However "Tyyppi_77" is hard for me to understand as a ...
1
vote
0answers
125 views
Avoiding Global Variables in Event Driven Programming
First off is "procedural event driven programming" a thing? My question is about global variables in the context of an event driven program that doesn't use OOP...
I have written a simple Snake game ...
0
votes
2answers
339 views
Launch event at the end of an animation with phaser 3
I'm starting to develop in Phaser 3, and I'm really a begginer.
I'm trying to make an attack move of an archer sprite, but I cannot make it work right...
This is how I have defined the things related ...
1
vote
1answer
275 views
Event manager/system for an open world adventure game in Unity
I'm making an adventure game set in a school (think Bully, but much less scope as I am one person) and I'm starting to program the last important systems like a sound manager and an event system and I'...
2
votes
1answer
40 views
Procedural vs Event Driven Paradigm Clash in HTML5
I've been writing some console-based games in python and got in the habit of having a "mainloop" that looks something like this (if it were ...
0
votes
1answer
179 views
Execute Timer Events of another Blueprint from the C++ UE4
I am having problem and it's about a week now that I still can't figure out how to get it right.
It seems that I can't run any functions from the blueprints that contain timers at all.
I have a ...
0
votes
1answer
161 views
Game states and events
I'm writting a game in C++ and I'm struggling with getting events and game states work together.
By game states I mean something like this
...
0
votes
2answers
675 views
unity: input event consumed by image raycast target that is “under” a sprite with a 2D collider
I am having a hard time getting my UI to work.
Basically I have a canvas with a UI image A that is the size of the screen. This image has raycast enabled and if effectively receiving inputs.
Not in ...
1
vote
1answer
339 views
4
votes
0answers
68 views
How to map interaction events to game actions
When I port between Desktop games and Mobile games, I find I always make a kludge out of the interaction events.
I typically end up hard-coding event handling for mobile, and event handling for the ...
2
votes
1answer
357 views
Run script after game start, before scene load
I'm making some kind of dependencies solving script. To work this script, it must be run before all other MonoBehaviour scripts.
So I made the script something like this:
...
1
vote
1answer
131 views
What's an acceptable delay between a player's action and the effects of the action being visible?
So, I'm creating a game where all the systems push events onto the event queue. Those events are then dispatched at the start of the next frame. This works fine, but there are some situations where ...
3
votes
1answer
68 views
Can Event Triggers be used on Non-UI objects?
Is there any way to use UI-Based event triggers on Non-UI objects?
Example : on any UI object, you add an EventTrigger component, set the event, and then set the ...
0
votes
0answers
37 views
Approach in implementing the web browser game
Im Phil and try to figoure out the best approach for my app.
I was searching Stack for my question but I didnt find a completely answer.
Assumptions:
It will be multiple user who can see in real time ...
0
votes
1answer
217 views
Possible patterns for Registering event listeners of game entities with an event queue
I'm trying to integrate the idea of an event queue with a game loop that creates entities and responds to input. Is it better practice to submit entity reaction functions to the queue during input ...
0
votes
1answer
100 views
Unity Events executed out of order
According to this page Events in unity are suppose to execute in a specific order. Specifically, OnCollisionEnter is supposed to be called right after OnTriggerEnter; however, FixedUpdate and Update ...
0
votes
1answer
2k views
How to call an event of level blueprint from NPC blueprint?
I have the following situation:
1 NPC that follows a path containing 3 parts. Target Point 1, Tower and Target Point 2.
It turns out that the first NPC that passes through the tower destroys it.
...
0
votes
0answers
239 views
Is it more efficient detect when audio clip ends with AudioSource.isPlaying or with AudioClip.length?
In Unity, I want to trigger an event when an audio clip finishes playing. Would it be more CPU efficient to keep checking if the audio clip is playing with
...
0
votes
0answers
74 views
How can I change the parameters of the random events for each game entity?
I'm trying to write an easy-to-use random event system that has certain conditions and effects in Unity. It's a simulation game that contains multiple Person, City, Country, Faction elements. I have ...