Teilen Sie Ihre Erfahrunge und Wünsche mit uns und anderen Usern!
Error importing the Package
I get this error when I import the package to Unity:
Assets/game4automation/private/RuntimeUI/SceneMouseNavigation.cs(801,38): error CS0103: The name 'SpaceNavigator' does not exist in the current context
No Mutex PLCSim Advanced Interface proble
Hello,
we are using the PLCSim Advanced Interface.
We can Import the PLCSignals without any Troubles:

The first time that we start the simulation in Unity everything is working fine (COM OK).
But after we stop the unity editor and try to start again, we get “No Mutex”... so no communication is established between the plc and Unity.
We found out that creating a new PLC Instance and re-importing the signals “fix the error”... but just for the first run. Then we have to repeat the process of creating a new PLC again and again...
Could be some background process blocking the communication? Thank you in advance.
realvirtualController CPU 500ms+
1.realvirtualController CPU 500ms+
private static void PreFixedUpdateCallback()
{
_fixedUpdateFrameCount++;
for (int i = 0; i < _preFixedUpdateHandlers.Count; i++)
{
if (_preFixedUpdateHandlers[i] != null)
{
try
{
_preFixedUpdateHandlers[i].PreFixedUpdate();
}
catch (System.Exception e)
{
//The performance analyzer determined that the `Object.FindFirstObjectByType()` call was taking more than 150ms++, so it was moved inside the catch block to avoid errors on every refresh.
var controllerInstance = Global.realvirtualcontroller ?? Object.FindFirstObjectByType();
Logger.Error($"Error in PreFixedUpdate: {e.Message}", controllerInstance);
}
}
}
}
//! Callback executed after FixedUpdate
private static void PostFixedUpdateCallback()
{
for (int i = 0; i < _postFixedUpdateHandlers.Count; i++)
{
if (_postFixedUpdateHandlers[i] != null)
{
try
{
_postFixedUpdateHandlers[i].PostFixedUpdate();
}
catch (System.Exception e)
{
//The performance analyzer determined that the `Object.FindFirstObjectByType()` call was taking more than 150ms++, so it was moved inside the catch block to avoid errors on every refresh.
var controllerInstance = Global.realvirtualcontroller ?? Object.FindFirstObjectByType();
Logger.Error($"Error in PostFixedUpdate: {e.Message}", controllerInstance);
}
}
}
}
2.The bug in the MQTT code has been fixed in the reply.
MQTT IN/OUTPUT ERROR [Repair] / realvirtual.io Forum / realvirtual.io (formerly game4automation)
HelloWindow occasionally blocks CI builds when running Unity in batchmode
Hi,
when we trigger our build pipeline and run tests or build the project via script, from time to time the HelloWindow pops up and blocks the pipeline run.
Context
-
We are using realvirtual in a Unity project that we build and test via Azure DevOps.
-
Unity is started from the pipeline in batchmode (no user interaction, headless build).
-
Typical commands are like:
-batchmode -projectPath <path> -runTestsor-batchmode -projectPath <path> -buildWindows64Player <path> ...
Most of the time this works fine, but occasionally the HelloWindow appears during startup and seems to wait for user interaction. Since this happens on a build server without UI interaction, the process just hangs and the entire CI job times out.
Expected behavior
-
When Unity is running in batchmode (CI environment), realvirtual should not open the HelloWindow at all, or
-
There should be an option (e.g. a setting, scripting define symbol, or asset menu option) to completely disable the HelloWindow for automated builds/tests.
Actual behavior
-
Infrequently, the HelloWindow still appears during CI runs, even though Unity is started in batchmode.
-
This blocks the build/test pipeline until it times out.
Questions / requests
-
Is there a recommended way to disable the HelloWindow for CI/batchmode runs?
-
Could realvirtual internally check for
Application.isBatchModeand skip showing the HelloWindow in that case? -
If there is already a setting or flag to turn this off, could you point me to the correct configuration?
Thanks a lot in advance!

RE: HelloWindow occasionally blocks CI builds when running Unity in batchmode
Hi Ramon,
Thanks for the detailed report. You're right - we check for UNITY_CLOUD_BUILD but we're missing a check for Application.isBatchMode which is why it can still appear when running Unity with -batchmode for CI pipelines.
Workarounds until the official fix:
Option 1: Add DEV define to your build command (Recommended)
Unity.exe -batchmode -projectPath C:\Project -runTests ... -defineSymbols DEV
Option 2: Set the define via script before tests run Create an editor script that runs before your tests:
[InitializeOnLoad]
public static class CISetup
{
static CISetup()
{
if (Application.isBatchMode)
{
// Prevents HelloWindow from showing
PlayerSettings.SetScriptingDefineSymbols(
NamedBuildTarget.Standalone, "DEV");
}
}
}
Option 3: Patch locally In Assets/realvirtual/private/Editor/OnPostProcessImportAsset.cs line 142, change:
if (Game4AutomationImport && !Application.isPlaying)
to:
if (Game4AutomationImport && !Application.isPlaying && !Application.isBatchMode)
Fix: We'll include this batch mode check in the next release.
Thanks for reporting!
How to solve the complie error when realvirtual io package install in HDRP project
Dear,
Thanks for your support.
I have another problem when realvirtual io package install in HDRP project.
1) Unity 6 LTS Version (6000.0.62f1)
2) Create HDRP Project
3) Install Reavirtual IO Digital Twin Professional (6.0.8)
→ Compile error occurs (see image below)
4) Switch to HDRP Menu (in realvirtual menu)
※ Render Pipelines > Switch to HD render Pipeline (HDR) > Path Tracing & Ray Tracing (Both Try)
→ Compile error still occurs (see image below)
I would like to request guidance on how to resolve this issue so I can use realvirtual io in HDRP project.
Best regards,
Seokhyun Lee



Hi,
usually you should not change render pipline. Some special materials for highlighting, the bottom, the fences... wont work in HDRP. If you are working with a totally new scene and taking care about the materials and rederers yourself it is ok. Also switching is a very complicated process.
I am sending you in a private message a beta of next release where the compile errors are gone away. If you are having issues when switching one project from URP to HDRP sometimes closing Unity and deleting the Library folder and restarting helps.
The private message will follow.
Best regards
Thomas
S7 connection - get_gameObject can only be called from the main thread.
Hi,
When trying to make an S7 connection (new empty scene) in the realvirtual.IO starter kit I have following issue.
The connection is OK and running in Scene mode, but once in Game mode, I see I have following error:
Connection failed: get_gameObject can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
In the connection view of TIA portal I see a lot of connection active.
Does anyone has any advise on how to solve this?
Unity version

siemens CPU 1515-2-PN



Connection failed: get_gameObject can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.

How to build a gantry
Hi everyone,
I’m trying to figure out the best way to model a gantry in realvirtual and I’d like to check if my approach makes sense.
Mechanical setup
-
Think of a classic gantry crane
-
In my machine I have
-
Two separate X-axes at the bottom (front and back rails – green arrows).
They can move independently in X, but in normal operation they should behave like a gantry pair. -
On top of them sits a Y-axis stage (blue arrows) that moves sideways.

-
-
The Y-stage is physically connected to the X-axes via joints in Unity.
-
The CAD / Unity hierarchy is basically flat – the Y-stage is not a child of one of the X carriages, so I cannot rely on parenting to move it together with X.
Control side
-
I have separate drives / axis values for:
-
X-front
-
X-back
-
Y-stage
-
-
The requirement is:
-
When X moves, the whole Y-stage must move with it.
-
Y should still have its own motion relative to the gantry.
-
Questions
-
What is the recommended realvirtual setup for this kind of gantry?
-
How should I combine this with joints?
-
Should I keep the joints at all, or would you recommend a purely kinematic Axis/Drive setup for this use case?
-
Any hints, best practices, or “don’t do this” stories are very welcome.
Thanks in advance!
Hi,
Thanks for reaching out!
For building hierarchical structures in your simulation, we'd recommend using parenting or Groups combined with Kinematic — you can find detailed guidance here: https://doc.realvirtual.io/components-and-scripts/motion/kinematic
One of the nice things about this approach is that it gives you flexibility regardless of how your Unity hierarchy is currently organized. Moving drives without physical joints also tends to provide better stability, which is especially helpful when you're receiving cyclic position updates from controllers.
As a tip that might simplify things: from a kinematic perspective, X-Front and X-Back effectively function as a single drive, so you may not need to model them separately — that could save you some setup work!
Let me know if you have any questions or if I can help clarify anything further.
Best regards
Thomas
SceneMouseNavigation.LateUpdate uses FindObjectsByType<TMP_InputField> every frame → catastrophic global scan on large scenes
LateUpdate in SceneMouseNavigation calls CheckForFocusedFields which uses FindObjectsByType.
On large scenes, this per-frame global lookup produces unacceptable frame times.
FindObjectsByType should not be called every frame.
This is the profiler result with 4000 active and 400.000 inactive objects in the scene:

Same scene with an early return in CheckForFocusedFields.


Environment:
- Unity 6000.2.10f1
- realvirtual-Professional-6.2.1
- Windows 10 x64
- RAM 32 GB
- CPU Intel Xeon W-11955M @2.6 GHz (8 Cores)
S7_Interface AreaReadWriteMode MinAreaDBInput causes data reading exception
Hello, I am a Chinese user and I greatly appreciate your company's products
Based on the Pro6 Ver8152 test, the S7_interface AreaReadWriteMode DB test found the following issues (everything is normal in non AreaReadWriteMode mode, but the communication load is high):
1.At the beginning, the O/I of my DB5 corresponded to PLC Output/Input and S7_interface settings:
AreaReadWriteMode:True
DBOutputs:5
MinAreaDBOutput:0
MaxAreaDBOutput:143
DBInputs:5
MinAreaDBInput:144
MaxAreaDBInput:277
ArgumentException: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
System.Buffer.BlockCopy (System.Array src, System.Int32 srcOffset, System.Array dst, System.Int32 dstOffset, System.Int32 count) (at :0)
realvirtual.S7Interface.WriteS7 () (at Assets/realvirtual/Interfaces/S7TCPIP/S7Interface.cs:933)
realvirtual.S7Interface.CommunicationThreadUpdate () (at Assets/realvirtual/Interfaces/S7TCPIP/S7Interface.cs:1083)
realvirtual.InterfaceThreadedBaseClass.CommunicationThread (System.Threading.CancellationToken token) (at Assets/realvirtual/Interfaces/InterfaceThreadedBaseClass.cs:226)
realvirtual.InterfaceThreadedBaseClass.b__36_0 () (at Assets/realvirtual/Interfaces/InterfaceThreadedBaseClass.cs:124)
System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) (at :0)
System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at :0)
System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at :0)
System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) (at :0)
System.Threading.ThreadHelper.ThreadStart () (at :0)
UnityEngine.<>c:b__0_0(Object, UnhandledExceptionEventArgs)
2. Through debugging and positioning, I modified some of the code and wrote it to PLC.DB.tags normally, but all reads failed without any errors:
WriteS7()
{
...
if (AreaReadWriteMode)
{
...
case S7InterfaceSignal.S7TYPE.BYTE:
Buffer.BlockCopy(bytes, 0, dstarea, pos, 1);
break;
case S7InterfaceSignal.S7TYPE.WORD:
Buffer.BlockCopy(bytes, 0, dstarea, pos, 2);
break;
case S7InterfaceSignal.S7TYPE.DWORD:
Buffer.BlockCopy(bytes, 0, dstarea, pos, 4);
break;
case S7InterfaceSignal.S7TYPE.SINT:
Buffer.BlockCopy(bytes, 0, dstarea, pos, 2);
break;
case S7InterfaceSignal.S7TYPE.INT:
Buffer.BlockCopy(bytes, 0, dstarea, pos, 2);
break;
case S7InterfaceSignal.S7TYPE.DINT:
Buffer.BlockCopy(bytes, 0, dstarea, pos, 4);
break;
case S7InterfaceSignal.S7TYPE.USINT:
Buffer.BlockCopy(bytes, 0, dstarea, pos, 1);
break;
case S7InterfaceSignal.S7TYPE.UINT:
Buffer.BlockCopy(bytes, 0, dstarea, pos, 2);
break;
...
}
...
}
3. Clone PLC DB5 to DB3, set DBInputs to 3, MinAreaDBInput to 0, and read/write everything is normal
4. Modify MinAreaDBInput: 2, the last 2Byte Read in the Read area is invalid
Modify MinAreaDBInput: 4, the last 4Byte Read in the Read area is invalid
... and so on
5.In OPCUA mode, Unity is played twice, but the value of PLCINput is restored to default, but the PLC memory remains in the same state as when the first attempt ended without any changes
6. I debugged the same Unity simulation project implementation based on our own S7.NET communication program: the conveyor belt transfers the tray until the PLC detects the Unity sensor signal and stops, and the OPCUA signal of RealVirtual.io always detects it and runs for a distance before stopping (the faster the speed, the farther it exceeds the distance). However, our own use of S7.NET does not have this problem (we use S7.NET.ReadClass to batch read, parse, update the drive object, update the ValueChange, update the WriteData, and WriteClass to time 50ms WirteData to the PLC).
Could you please help analyze and provide feedback on the above issues? Additionally, I have code to convert the DB exported by the PLC into complete XML, and I hope to modify it into the tag import mechanism of OPCUA in the future (as RealVirtual 6 does not support DB import, I am currently using OPCUA to import PLCTags, and then using OpcuaTagoS7 to change the OPCUA tag to S7Interface AreaReadWriteMode for communication, as I am concerned about the performance issues of OPCUA's subscription mode for large-scale PLCTAGS)
I have sent you the relevant attachments via email. Regarding the method of generating PlcTagsXML from DB, you can also contact me if you need it, because we have successfully tested and verified this aspect through the project (the method found online has multiple bugs in the calculation of S7 address offset).
Looking forward to your reply~
S7_Interface AreaReadWriteMode Debug.zip
By:Liuxingsuifeng
Email: 410701881@qq.com
We fixed all things discussed in this thread - will be available in upcoming release 6.0.8
Customer support service by UserEcho