The ToolSimulator component allows a tool to be used without needing it to be equipped by a user. You can make use of a tool's primary and secondary actions but not context menu actions.
{{Infobox Component
|Image=ToolSimulatorComponent.jpg
|Name=Tool Simulator
}}
The ToolSimulator [[Component]] allows a tool to be used without needing it to be equipped by a [[User]]. You can make use of a [[Tools|Tool's]] primary and secondary actions but not context menu actions.
You need to provide a reference to the tool component that you want to simulate, and also a reference to a simulating user. You can then make use of the Primary, Secondary, Strength and Axis properties.
You need to provide a [[reference]] to the tool component that you want to simulate, and also a reference to a simulating user. You can then make use of the Primary, Secondary, Strength and Axis properties.
For example, providing a reference to a MaterialTool and then making use of the Primary property will allow you to apply materials to objects in front of the tool.
For example, providing a reference to a [[Material Tool]] and then making use of the Primary property will allow you to apply [[Material|materials]] to objects in front of the tool.
== Fields ==
{{Table ComponentFields
|Tool|ITool| The tool to simulate the use of.
|SimulatingUser|User| The user that should simulate the tool.
|Primary|Bool| Whether <code>Tool</code> should be simulated as holding primary.
|Secondary|Bool| Whether <code>Tool</code> should be simulated as holding secondary.
|Strength|Float| The primary strength the <code>Tool</code> should be simulated as using.
|Axis|Float2| The position axis (like trackpad) the <code>Tool</code> should be simulated as using.
}}
== Known Bugs ==
Currently the primary of the [[Dev Tool]] is not simulated properly and can not move gizmos. <ref>https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/3570</ref>
The ToolSimulator Component allows a tool to be used without needing it to be equipped by a User. You can make use of a Tool's primary and secondary actions but not context menu actions.
You need to provide a reference to the tool component that you want to simulate, and also a reference to a simulating user. You can then make use of the Primary, Secondary, Strength and Axis properties.
For example, providing a reference to a Material Tool and then making use of the Primary property will allow you to apply materials to objects in front of the tool.