-
Posts
220 -
Joined
-
Last visited
Community Answers
-
Andy90's post in Texture flickering was marked as the answer
An RTX 3060. Its kinda wired i test it in a new project without an issue. But in my game project it still occuring. Even with an empty map
https://streamable.com/l5f7uw
Seems its related to this line of code
camera->SetRange(0.001, 1000.0); if i use this, the flickering is there. If i comment it out the flickering is starting you can see it in the video below
https://streamable.com/aehnbd
-
Andy90's post in How to perform action with widget button click was marked as the answer
Okey i figured out the problem and how to fix it. It might be usefull for some other people so i post my solution. First of all i found this post
this means you can have only one event queue. There is allready one within the main.lua. If you want process the events within multiple scripts you need to edit the event queue like this
Main.lua
--Update events while EventQueue:Peek() do local event = EventQueue:Wait() event = gamemenu:ProcessEvent(event) -- Own Event Callbacks paste the following bellow for x = 0, world:CountEntities() - 1 do local entity = world:GetEntity(x); local entityScript = entity.script; if entityScript and entityScript.ProcessEvent then entityScript:ProcessEvent(event); end end end with this edit the main loop will iterate all entitys in your map and checks if the entity has a script attached and if the script have the "ProcessEvent" function. If this statement true it will call the ProcessEvent function within this script and sets the event message as parameter. So you can now insert this function in your scripts and handle events in diffrent scripts like this
Example Script attached to an entity
function Script:ProcessEvent(event) System:Print(event.source); if event.source == btnDrop then System:Print("Hello Button Event!"); end end