Conversation
… and apply same material to all objects.
…n implementations.
There was a problem hiding this comment.
Pull request overview
This PR updates Visual Pinball Engine’s Unity integration to improve gameplay fidelity (plunger + flipper tricks/live-catch), expand the VPX import workflow with collider-focused modes, and refine runtime/editor tooling (native input mappings, lamp toggling, physics debug visualization, and UV/material handling).
Changes:
- Added new plunger coil mode (“fire and pull back”) and updated flipper tricks/live-catch parameters/logic to better match modern VPW behavior.
- Expanded VPX import options (collidable-only import, skipping textures/sounds, dumping table script, override materials) and fixed playfield UV projection.
- Updated native input actions/default bindings, switch dispatch behavior, and added editor-only physics render masking/debugging utilities.
Reviewed changes
Copilot reviewed 39 out of 40 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| VisualPinball.Unity/VisualPinball.Unity/VPT/Ramp/RampWireMeshComponent.cs | Uses ramp mesh-generation data that can be derived from collider geometry during import. |
| VisualPinball.Unity/VisualPinball.Unity/VPT/Ramp/RampWallMeshComponent.cs | Same as above for ramp wall meshes. |
| VisualPinball.Unity/VisualPinball.Unity/VPT/Ramp/RampFloorMeshComponent.cs | Same as above for ramp floor meshes. |
| VisualPinball.Unity/VisualPinball.Unity/VPT/Ramp/RampComponent.cs | Adds collider-driven ramp mesh data path and collision-wall height mapping for collider-only import workflows. |
| VisualPinball.Unity/VisualPinball.Unity/VPT/Plunger/PlungerComponent.cs | Exposes new coil item id for “fire and pull back”. |
| VisualPinball.Unity/VisualPinball.Unity/VPT/Plunger/PlungerApi.cs | Implements new coil behavior and supports firing from full retract vs current position. |
| VisualPinball.Unity/VisualPinball.Unity/VPT/Playfield/PlayfieldComponent.cs | Applies playfield UV projection based on table bounds during referenced-data setup. |
| VisualPinball.Unity/VisualPinball.Unity/VPT/MainRenderableComponent.cs | Allows import-time skipping of surface parenting via ImportContext. |
| VisualPinball.Unity/VisualPinball.Unity/VPT/Light/LightComponent.cs | Tracks emissive renderers as faux bulbs; ensures dark-at-start and hides/dims with intensity. |
| VisualPinball.Unity/VisualPinball.Unity/VPT/Flipper/FlipperTricksData.cs | Adds base dampen parameters for updated live-catch model. |
| VisualPinball.Unity/VisualPinball.Unity/VPT/Flipper/FlipperComponent.cs | Plumbs new live-catch parameters from collider component into runtime data. |
| VisualPinball.Unity/VisualPinball.Unity/VPT/Flipper/FlipperColliderComponent.cs | Updates tooltip text and defaults to align with modern VPW-style tuning. |
| VisualPinball.Unity/VisualPinball.Unity/VPT/Flipper/FlipperCollider.cs | Reworks live-catch logic and integrates it into collision flow. |
| VisualPinball.Unity/VisualPinball.Unity/VPT/Bumper/BumperComponent.cs | Adds editor-only collider-visual import mode for bumper collider-focused workflows. |
| VisualPinball.Unity/VisualPinball.Unity/Simulation/SimulationThread.cs | Adds switch inversion/toggle behaviors and expands flipper action classification and hint mapping. |
| VisualPinball.Unity/VisualPinball.Unity/Simulation/NativeInputManager.cs | Adds polling-state exposure and expands default native bindings. |
| VisualPinball.Unity/VisualPinball.Unity/Simulation/NativeInputApi.cs | Expands native input action/keycode enums to cover more cabinet controls. |
| VisualPinball.Unity/VisualPinball.Unity/Input/InputManager.cs | Adjusts default InputSystem bindings for coins/service actions. |
| VisualPinball.Unity/VisualPinball.Unity/Import/ImportContext.cs.meta | New Unity meta for ImportContext. |
| VisualPinball.Unity/VisualPinball.Unity/Import/ImportContext.cs | Introduces global import-time flags consumed by runtime components during editor conversion. |
| VisualPinball.Unity/VisualPinball.Unity/Game/SwitchPlayer.cs | Avoids double-dispatch by skipping InputSystem switch path when native polling is active. |
| VisualPinball.Unity/VisualPinball.Unity/Game/PhysicsRenderMaskComponent.cs.meta | New Unity meta for physics render mask component. |
| VisualPinball.Unity/VisualPinball.Unity/Game/PhysicsRenderMaskComponent.cs | Adds editor-only physics-collider render masking for debugging physics-relevant geometry. |
| VisualPinball.Unity/VisualPinball.Unity/Game/CoilPlayer.cs | Initializes “fire and pull back” plunger mode to a pulled-back idle state on startup. |
| VisualPinball.Unity/VisualPinball.Unity.Editor/VPT/Flipper/FlipperColliderInspector.cs | Exposes new live-catch fields and updates labels for clarity. |
| VisualPinball.Unity/VisualPinball.Unity.Editor/Utils/AssetReferenceLocator.cs | Sorts results for determinism/readability in editor tooling output. |
| VisualPinball.Unity/VisualPinball.Unity.Editor/Managers/Lamp/LampManager.cs | Improves lamp toggling to use APIs in play mode and handle groups/edit-mode correctly. |
| VisualPinball.Unity/VisualPinball.Unity.Editor/Import/VpxSceneConverter.cs | Adds new import options (filters, dumping script, override materials) and sets ImportContext flags during conversion. |
| VisualPinball.Unity/VisualPinball.Unity.Editor/Import/VpxImportWizardSettings.cs | Stores new import wizard settings in EditorPrefs and builds ConvertOptions. |
| VisualPinball.Unity/VisualPinball.Unity.Editor/Import/VpxImportWizard.cs | Extends wizard UI to configure new import modes/options and passes ConvertOptions through import. |
| VisualPinball.Unity/VisualPinball.Unity.Editor/Import/MenuImporter.cs | Adds a menu item to open the import wizard preconfigured for collidable-only workflow. |
| VisualPinball.Unity/Plugins/linux-x64/libVpeNativeInput.so.meta | Updates Linux native input plugin importer metadata (platform gating needs correction). |
| VisualPinball.Unity/Documentation~/developer-guide/setup.md | Documents NativeInput’s NuGet + plugin-copy workflow and updates meta ignore guidance. |
| VisualPinball.Unity/Documentation~/creators-guide/toc.yml | Adds “Plungers” page to creators guide TOC. |
| VisualPinball.Unity/Documentation~/creators-guide/manual/mechanisms/plungers.md | New creator documentation for plunger setup and coil modes (incl. kickback pattern). |
| VisualPinball.Unity/Assets/Resources/Materials/Segment Display (SRP).mat | Material version refresh update. |
| VisualPinball.Unity/Assets/Resources/Materials/Dot Matrix Display (SRP).mat | Material version refresh update. |
| VisualPinball.Engine/VisualPinball.Engine.csproj | Bumps VisualPinball.NativeInput to v0.0.4 and clarifies NuGet deployment intent. |
| VisualPinball.Engine/VPT/Table/TableMeshGenerator.cs | Adjusts playfield triangulation to match VPX’s implicit mesh. |
| .gitignore | Ignores AGENTS.md. |
Comments suppressed due to low confidence (1)
VisualPinball.Unity/Plugins/linux-x64/libVpeNativeInput.so.meta:47
- The plugin import settings for
libVpeNativeInput.soappear to enable the Linux.sofor Windows (Win/Win64) and forAnywithExclude Win/Win64 = 0. This will cause Unity to try to load/include the Linux binary on Windows builds/editors. Update the.metaso onlyLinux64(and Linux Editor) are enabled, withAnydisabled (or excluding Win/Win64), matching the platform gating used by other plugins inPlugins/<rid>.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Greptile SummaryThis is a broad multi-area PR touching simulation fidelity, import tooling, platform input, and runtime rendering. The changes are well-structured and the core logic is sound across all areas. Key changes:
Confidence Score: 4/5Safe to merge; the one logic issue is isolated to a debug-only editor component and requires a very specific timing window to trigger. The core simulation changes (live-catch rewrite, plunger coil, input dispatch) are well-implemented. The import pipeline correctly saves and restores global state. The prior thread concern about live-catch defaults was explicitly resolved by the author. The only newly-found functional issue (PhysicsRenderMaskComponent.Start coroutine not checking IsEnabled before Apply()) is confined to a debug editor-only tool and requires toggling the component during the up-to-300-frame physics engine init window — an unlikely scenario in practice. VisualPinball.Unity/VisualPinball.Unity/Game/PhysicsRenderMaskComponent.cs — Start() coroutine Apply() guard Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
subgraph Import["Import Pipeline (VpxSceneConverter)"]
IO["ImportOptions"] --> F1{"ObjectImportFilter\n= CollidableOnly?"}
F1 -- Yes --> IC["ImportContext.UseCollider\nGeometryFor*Meshes = true"]
IC --> FC["Filter renderables\nto physics-loop objects only"]
FC --> BC["BumperComponent:\nApplyColliderOnlyVisual()"]
FC --> RC["RampComponent:\nGetMeshGenerationData()\n→ CollisionGeometryRampData"]
F1 -- No --> ALL["Import all renderables\n(normal path)"]
IO --> F2{"DumpTableScript?"}
F2 -- Yes --> DS["Write .vbs file to Assets"]
IO --> F3{"OverrideVisualMaterial?"}
F3 -- Yes --> OM["All objects share\none override material"]
F3 -- No --> NM["Normal PBR material pipeline"]
end
subgraph Simulation["Simulation / Input"]
NIM["NativeInputManager\n(polling thread)"] --> ST["SimulationThread"]
ST --> ATS["_actionSwitchStates[]\n(NC + toggle-on-press aware)"]
ATS --> ID["InputDispatcher\n.DispatchSwitch()"]
UIS["Unity InputSystem\n(fallback when not polling)"] --> SP["SwitchPlayer\nHandleKeyInput()"]
SP --> ID
CN["GetCanonicalActionName()"] -. normalizes .-> SP
CN -. normalizes .-> ST
end
subgraph Physics["Physics / Simulation Fidelity"]
FC2["FlipperCollider.Collide()"] --> LC["LiveCatch()\nnow called AFTER impulse\nwith in FlipperTricksData"]
PA["PlungerApi"] --> FAPC["FireAndPullBackCoil\n→ FireFromFullRetract / PullBack"]
end
subgraph Debug["Debug (Editor-only)"]
PRMC["PhysicsRenderMaskComponent"] --> APL["Apply()\nDisables original renderers\nGenerates collider mesh geometry"]
APL --> CM["BuildColliderMesh()\nLine / Circle / Triangle / Flipper"]
end
Reviews (2): Last reviewed commit: "packaging: Add missing attributes." | Re-trigger Greptile |
Gameplay / Simulation fidelity
Import pipeline and authoring workflow
Performance / runtime correctness
Platform / input / dependency updates
v0.0.4.Docs / developer support
Practical Impact