<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Benny Fathurrahman on Medium]]></title>
        <description><![CDATA[Stories by Benny Fathurrahman on Medium]]></description>
        <link>https://medium.com/@bennyfathurr?source=rss-65219fc42daa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*NSsC_uGFdI42lL84okCTcw.png</url>
            <title>Stories by Benny Fathurrahman on Medium</title>
            <link>https://medium.com/@bennyfathurr?source=rss-65219fc42daa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 14:21:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bennyfathurr/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Toggle a menu with the left thumb and middle finger in Unreal Engine 5.8 on Vision Pro]]></title>
            <link>https://medium.com/@bennyfathurr/toggle-a-menu-with-the-left-thumb-and-middle-finger-in-unreal-engine-5-8-on-vision-pro-3924a9b79e97?source=rss-65219fc42daa------2</link>
            <guid isPermaLink="false">https://medium.com/p/3924a9b79e97</guid>
            <category><![CDATA[unreal-engine-5]]></category>
            <category><![CDATA[spatial-development]]></category>
            <category><![CDATA[apple-vision-pro]]></category>
            <category><![CDATA[unreal-engine]]></category>
            <category><![CDATA[xrdevelopment]]></category>
            <dc:creator><![CDATA[Benny Fathurrahman]]></dc:creator>
            <pubDate>Wed, 25 Nov 2026 03:46:32 GMT</pubDate>
            <atom:updated>2026-11-25T03:46:32.323Z</atom:updated>
            <content:encoded><![CDATA[<p>Chapter : Bonus</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bivmhRdqNpAyXh78EtYGQw.png" /></figure><p>I wanted a menu gesture I could use alongside the regular grab. I confirmed that a left thumb–middle pinch opens and closes the panel on Vision Pro. This lesson builds on Part 6’s index pinchand the existing hand visualizer.</p><p>What you will see. A left-hand thumb-to-middle-finger pinch opens the Hand Menu. Release the fingers, then pinch again to close it.</p><p>Before you begin. Reuse the tracking and pinch state from Chapters 2 and 6. This chapter adds a separate recognizer inside the left-hand update, then uses it to switch one visibility flag.</p><h3>Implement the gesturelink</h3><ol><li>Add a separate FPinchState LeftMiddlePinch and a bGesturePanelOpen flag to AVisualizeHand.</li><li>Use the existing tracked left-hand sample to read ThumbTip, MiddleTip, and IndexTip. Convert the thumb-to-middle distance from Unreal world units to centimeters using the current world scale.</li><li>On an invalid sample, reset the gesture state. When the thumb and middle finger separate to at least 3 cm, arm the next gesture. When they close to 2 cm or less, latch the gesture and toggle only if the index pinch is inactive and the thumb is at least 3 cm from the index tip.</li><li>Create the panel from a mesh component and a centered UTextRenderComponent. When opening, position both from the current player view and face the panel toward the player. Leave it at that position until the next opening.</li><li>Set both components’ visibility from bGesturePanelOpen. Log the transition and package a visionOS Development build for the headset.</li></ol><p>Inside the per-hand update in VisualizeHand.cpp, place this after the index-pinch recognizer and before updating its marker. It uses the menu mesh and text components created in the constructor.</p><p>The index clearance check happens after the middle-finger gesture has latched. If both gestures compete, the menu stays as it was and the middle finger must reopen before the next attempt. This also prevents a hold from triggering later when the index finger moves away.</p><pre>if (Hand == EControllerHand::Left)<br>{<br>    const FVector MiddleTip = bTracked<br>        ? State.HandKeyLocations[static_cast&lt;int32&gt;(EHandKeypoint::MiddleTip)]<br>        : FVector::ZeroVector;<br>    if (!bUsable || MiddleTip.ContainsNaN())<br>    {<br>        LeftMiddlePinch = FPinchState{};<br>    }<br>    else<br>    {<br>        const double DistanceCm = FVector::Distance(Thumb, MiddleTip) / UnitsPerCm;<br>        if (DistanceCm &gt;= 3.0)<br>        {<br>            LeftMiddlePinch.bNeedsOpen = false;<br>            LeftMiddlePinch.bActive = false;<br>        }<br>        else if (DistanceCm &lt;= 2.0 &amp;&amp; !LeftMiddlePinch.bNeedsOpen &amp;&amp; !LeftMiddlePinch.bActive)<br>        {<br>            LeftMiddlePinch.bActive = true;<br>            constexpr double IndexClearanceCm = 3.0;<br>            if (!Pinch.bActive &amp;&amp; FVector::Distance(Thumb, IndexTip) &gt;= IndexClearanceCm * UnitsPerCm)<br>            {<br>                if (const APlayerController* Controller = GetWorld()-&gt;GetFirstPlayerController())<br>                {<br>                    bGesturePanelOpen = !bGesturePanelOpen;<br>                    if (bGesturePanelOpen)<br>                    {<br>                        FVector ViewLocation;<br>                        FRotator ViewRotation;<br>                        Controller-&gt;GetPlayerViewPoint(ViewLocation, ViewRotation);<br>                        const FVector Forward = FRotator(0.0, ViewRotation.Yaw, 0.0).Vector();<br>                        const FVector Right = FVector::CrossProduct(FVector::UpVector, Forward);<br>                        const FVector Center = ViewLocation +<br>                            (Forward * 85.0 - Right * 28.0 - FVector::UpVector * 9.0) * UnitsPerCm;<br>                        const FRotator Facing = (ViewLocation - Center).Rotation();<br>                        GesturePanel-&gt;SetWorldLocationAndRotation(Center, Facing);<br>                        GesturePanel-&gt;SetWorldScale3D(FVector(0.012, 0.38, 0.22) * UnitsPerCm);<br>                        GesturePanelText-&gt;SetWorldLocationAndRotation(<br>                            Center + Facing.Vector() * UnitsPerCm, Facing);<br>                        GesturePanelText-&gt;SetWorldSize(2.3 * UnitsPerCm);<br>                    }<br>                    GesturePanel-&gt;SetVisibility(bGesturePanelOpen);<br>                    GesturePanelText-&gt;SetVisibility(bGesturePanelOpen);<br>                    UE_LOG(LogTemp, Display, TEXT(&quot;HandLab: left middle pinch menu %s&quot;),<br>                        bGesturePanelOpen ? TEXT(&quot;opened&quot;) : TEXT(&quot;closed&quot;));<br>                }<br>            }<br>        }<br>    }<br>}</pre><p>On open, place the panel 85 cm forward, 28 cm left and 9 cm below the view using yaw for the horizontal directions. Face it back toward the player and place the text 1 cm toward the viewer to keep it in front of the panel mesh.</p><h3>Test on Vision Prolink</h3><p>The gesture reads ThumbTip, MiddleTip, and IndexTip from the existing left-hand world-space sample. Start with the fingers open. Bringing thumb and middle finger within 2 cm triggers one toggle. Separate them to at least 3 cm before pinching again. Keep the index finger at least 3 cm from the thumb to distinguish this gesture from the regular grab pinch.</p><p>The menu appears about 85 cm forward, slightly left and below the view, and stays there while open. An invalid sample resets the recognizer and requires an open hand before another toggle. The menu keeps its current visibility during tracking loss. The right hand does not drive this gesture.</p><p>Test an open–pinch–hold–open–pinch sequence on Vision Pro. Confirm that holding the pinch triggers only once, the right hand leaves the panel alone, and the usual thumb–index grab still works. The Unreal log prints left middle pinch menu opened and closed.</p><h3>Read the toggle as a sequencelink</h3><p>Start with the left hand open. Close the thumb and middle finger while the index finger stays clear. Hold the pose and look for one log entry. Separate the two fingers to rearm, then pinch again. Try the same movement with the right hand and finally try the original thumb–index grab. The menu should stay as it was in both cases.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3924a9b79e97" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Look and pinch on Unreal Engine 5.8 in Vision Pro]]></title>
            <link>https://medium.com/@bennyfathurr/look-and-pinch-on-unreal-engine-5-8-in-vision-pro-77d3a992f180?source=rss-65219fc42daa------2</link>
            <guid isPermaLink="false">https://medium.com/p/77d3a992f180</guid>
            <category><![CDATA[spatial-development]]></category>
            <category><![CDATA[eye-gaze]]></category>
            <category><![CDATA[apple-vision-pro]]></category>
            <category><![CDATA[unreal-engine-5]]></category>
            <category><![CDATA[unreal-engine]]></category>
            <dc:creator><![CDATA[Benny Fathurrahman]]></dc:creator>
            <pubDate>Wed, 25 Nov 2026 03:46:19 GMT</pubDate>
            <atom:updated>2026-11-25T03:46:19.675Z</atom:updated>
            <content:encoded><![CDATA[<p>Chapter : 10</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a2RGuecoX_Xh0Fcv3bQo4A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bCxda4avP_3c5U6Bvb2z0g.png" /></figure><p>PrettiestThing uses UE 5.8.4 and OpenXRVisionOS. The installed runtime does not advertise XR_EXT_eye_gaze_interaction. OpenXREyeTracker is already enabled in the project, but the runtime must expose that extension for continuous gaze to work. The hand-joint pinch demo measures fingers and has no system selection ray.</p><p>Apple exposes an optional selection ray with a spatial input event. Compositor Services apps can receive those events through LayerRenderer.onSpatialEvent. This supports an experiment where the user looks at one of two targets and pinches while keeping their head still. The event ray can select the target without a continuous eye-pose stream. <a href="https://developer.apple.com/videos/play/wwdc2023/10089/">Apple’s compositor input walkthrough</a> · <a href="https://developer.apple.com/documentation/swiftui/spatialeventcollection/event/selectionray">Selection ray API</a></p><p>What you will see. Two blue targets appear in front of you. Look toward one and make the usual indirect selection pinch. The hit target turns yellow. The input to our game is a ray delivered with an event.</p><p>If you have never written Swift. Think of a callback as code the system calls when an event arrives. Swift receives the event from Apple’s compositor. The Objective-C++ file is the bridge to Unreal and stores the newest ray until the C++ game thread can read it. A ray has a starting point and direction. The game uses it to choose a target.</p><h3>What Unreal can access on Vision Prolink</h3><h3>Separate four conceptslink</h3><p>Raw eye images are camera data. Continuous gaze pose is a direction/origin stream inferred from eye tracking. System-targeted interaction is an event delivered after the platform uses its own targeting. Head-directed pointing uses headset orientation.</p><p>These signals are not interchangeable. A person selecting a native button with their eyes does not establish that your Unreal Actor can query a continuous gaze ray. Likewise, a camera-forward ray follows head motion, even if it feels like looking at something.</p><p>Apple’s standard privacy model keeps eye input private while the system handles interaction. The platform can provide an interaction result without providing a continuous eye stream. <a href="https://www.apple.com/privacy/docs/Apple_Vision_Pro_Privacy_Overview.pdf">Apple Vision Pro Privacy Overview</a></p><h3>Evidence from the installed Unreal integrationlink</h3><p>In OXRVisionOS.cpp, StartupModule advertises the hand-tracking extension. The eye-gaze extension registration is commented out. OXRVisionOSInstance.cpp also contains commented eye-gaze integration code.</p><p>Therefore, this tutorial does not have an established continuous-eye-gaze path through the installed runtime. Enabling OpenXREyeTracker alone cannot add a runtime capability that is not exposed. A generic Unreal eye-tracker API existing in the editor is not a support test.</p><p>This conclusion is scoped to this engine/runtime path. It should not be generalized into a claim about every future Apple SDK, specialized entitlement or third-party integration. If considering an enterprise API, verify its exact data, entitlement and distribution requirements separately; enterprise status by itself is not proof of an eye-gaze API.</p><h3>A support decision procedurelink</h3><p>Before adding gaze-dependent gameplay:</p><ol><li>Identify the runtime used by the packaged app, not just the installed editor plugin.</li><li>Check whether the runtime advertises the required extension/capability.</li><li>Check whether the application’s plugin actually requests and uses it.</li><li>Read runtime availability and tracking status.</li><li>Test on device with eyes moving while the head remains still.</li><li>Confirm the returned signal changes with eye movement rather than head movement.</li><li>Document permission/entitlement and lifecycle behavior.</li></ol><p>For the inspected project, the advertised-capability step is already insufficient for the proposed continuous-gaze feature, so no eye-gaze implementation is supplied here.</p><h3>Why native UI examples do not transfer automaticallylink</h3><p>SwiftUI and RealityKit participate in Apple’s interaction system. A custom Unreal compositor scene has its own rendering and OpenXR integration. Native hover or targeted gestures must be evaluated as a separate integration task rather than assumed to appear on Unreal meshes.</p><p>Do not translate a native targeted event into a claim that the app can record where someone looks every frame. Those are materially different data access patterns. Apple’s guidance explains that system handling of eye/hand interaction is designed around privacy. <a href="https://developer.apple.com/documentation/visionos/adopting-best-practices-for-privacy">Privacy and user preferences</a></p><h3>1. Bridge the Compositor Services eventlink</h3><p>The prototype registers a project Swift callback on Unreal’s existing compositor layer. It submits the first available selection ray for each indirect pinch to a synchronized mailbox. On the game thread, Unreal converts the ray using the OpenXR axis convention, WorldToMeters for its origin, and the tracking-to-world transform. The demo tests the ray against two blue spheres and marks the nearest hit yellow. A miss clears the highlight. The mailbox keeps the latest event if several arrive before one game tick.</p><p>To reproduce the bridge, put SpatialInput.swift and SpatialInput.mm in the project&#39;s Private/VisionInput directory. In the visionOS block of PrettiestThing.Build.cs, add ApplicationCore, set SwiftInteropHeader to SpatialInputInterop.h, and link CompositorServices. The Swift code assigns layer.onSpatialEvent on the existing layer, so another callback on that layer would need to be composed with it. The Objective-C++ installer dispatches registration to the main queue when the layer changes. In Swift, deduplicate by active event ID and remove the ID when the event leaves its active phase.</p><pre>#if os(visionOS)<br>import CompositorServices<br>import SwiftUI<br><br>@_cdecl(&quot;PTInstallSpatialInput&quot;)<br>public func installSpatialInput(_ layer: LayerRenderer) {<br>    var activeEvents = Set&lt;SpatialEventCollection.Event.ID&gt;()<br>    layer.onSpatialEvent = { events in<br>        for event in events where event.kind == .indirectPinch {<br>            guard event.phase == .active else {<br>                activeEvents.remove(event.id)<br>                continue<br>            }<br>            guard !activeEvents.contains(event.id), let ray = event.selectionRay else { continue }<br>            activeEvents.insert(event.id)<br>            PTSubmitSelectionRay(ray.origin.x, ray.origin.y, ray.origin.z,<br>                                 ray.direction.x, ray.direction.y, ray.direction.z)<br>        }<br>    }<br>}<br>#endif</pre><h3>2. Convert the ray and select a targetlink</h3><p>Consume the mailbox in AVisualizeHand::Tick. Swizzle both vectors as (-Z, X, Y). Scale the origin from meters before applying tracking-to-world position conversion. Rotate and normalize the direction without applying translation. Calculate ray entry against each 10 cm target sphere and choose the closest eligible hit. The two targets sit 145 cm forward, 34 cm either side and 14 cm above the initial view.</p><h3>3. Verify head-still selectionlink</h3><p>The two targets appear at eye level and above the practice objects once the lab starts. Keep your head still and pinch in the same place while looking at the left target, then repeat for the right. The selected target should turn yellow. Check HandLab: indirect pinch selection left, right, or miss in the headset&#39;s Unreal log.</p><h3>Walk through the Swift callbacklink</h3><ol><li>#if os(visionOS) limits the code to visionOS. import makes the Apple framework types available.</li><li>@_cdecl exposes a symbol the bridge can call. activeEvents is a set of gesture IDs this callback has already submitted.</li><li>The for loop reads indirect pinches. The first guard removes ended events from the set and skips them. The second skips IDs already submitted and events that do not have a ray yet.</li><li>PTSubmitSelectionRay crosses into the Objective-C++ file and passes six numbers. The bridge stores them under a lock. C++ picks them up on its next game tick. No SwiftUI screen is needed in this approach.</li></ol><p>Hand Lab Actor implementation · Actor declarations · Swift callback · Objective-C++ bridge</p><h3>Read the event on the Unreal game threadlink</h3><p>In SpatialInput.mm, the callback writes the ray while holding a lock. The game thread calls this reader. It copies the pending values and clears the flag so the same selection is consumed once.</p><pre>bool ConsumeSpatialSelection(FVector&amp; OriginMeters, FVector&amp; Direction)<br>{<br>    const FScopeLock Lock(&amp;RayLock);<br>    if (!bRayPending)<br>    {<br>        return false;<br>    }<br>OriginMeters = PendingOrigin;<br>    Direction = PendingDirection;<br>    bRayPending = false;<br>    return true;<br>}</pre><p>In VisualizeHand.cpp, this is the entry point for the target test. The first transform moves the ray origin to world space. The second rotates the direction without shifting it.</p><pre>EnsureSpatialInputInstalled();<br>FVector OriginMeters;<br>FVector Direction;<br>if (ConsumeSpatialSelection(OriginMeters, Direction) &amp;&amp; bTargetPlaced &amp;&amp;<br>    !OriginMeters.ContainsNaN() &amp;&amp; !Direction.ContainsNaN())<br>{<br>    const FTransform TrackingToWorld = UHeadMountedDisplayFunctionLibrary::GetTrackingToWorldTransform(this);<br>    const FVector Origin = TrackingToWorld.TransformPosition(<br>        FVector(-OriginMeters.Z, OriginMeters.X, OriginMeters.Y) * (100.0 * UnitsPerCm));<br>    const FVector Ray = TrackingToWorld.TransformVectorNoScale(<br>        FVector(-Direction.Z, Direction.X, Direction.Y)).GetSafeNormal();<br>    int32 HitIndex = INDEX_NONE;<br>    double Closest = 1000.0 * UnitsPerCm;<br>    const double RadiusSquared = FMath::Square(10.0 * UnitsPerCm);<br>    for (int32 Index = 0; Index &lt; SelectionTargets.Num() &amp;&amp; !Ray.IsNearlyZero(); ++Index)<br>    {<br>        const FVector ToTarget = SelectionTargets[Index]-&gt;GetComponentLocation() - Origin;<br>        const double Along = FVector::DotProduct(ToTarget, Ray);<br>        const double OffsetSquared = (ToTarget - Ray * Along).SizeSquared();<br>        if (Along &gt; 0.0 &amp;&amp; OffsetSquared &lt;= RadiusSquared)<br>        {<br>            const double Entry = Along - FMath::Sqrt(RadiusSquared - OffsetSquared);<br>            if (Entry &lt; Closest)<br>            {<br>                Closest = Entry;<br>                HitIndex = Index;<br>            }<br>        }<br>    }<br>    for (int32 Index = 0; Index &lt; SelectionMaterials.Num(); ++Index)<br>    {<br>        if (auto* Material = SelectionMaterials[Index].Get())<br>        {<br>            Material-&gt;SetVectorParameterValue(TEXT(&quot;Color&quot;), Index == HitIndex<br>                ? FLinearColor::Yellow : FLinearColor(0.05f, 0.55f, 1.f));<br>        }<br>    }<br>    UE_LOG(LogTemp, Display, TEXT(&quot;HandLab: indirect pinch selection %s&quot;),<br>        HitIndex == 0 ? TEXT(&quot;left&quot;) : (HitIndex == 1 ? TEXT(&quot;right&quot;) : TEXT(&quot;miss&quot;)));<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77d3a992f180" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I got my Unreal Engine project to show up in full immersion on Apple Vision Pro]]></title>
            <link>https://medium.com/@bennyfathurr/how-i-got-my-unreal-engine-project-to-show-up-in-full-immersion-on-apple-vision-pro-e1c780f771dd?source=rss-65219fc42daa------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1c780f771dd</guid>
            <category><![CDATA[apple-vision-pro]]></category>
            <category><![CDATA[unreal-engine-5]]></category>
            <category><![CDATA[spatial-development]]></category>
            <category><![CDATA[unreal-engine]]></category>
            <category><![CDATA[tips-and-tricks]]></category>
            <dc:creator><![CDATA[Benny Fathurrahman]]></dc:creator>
            <pubDate>Tue, 24 Nov 2026 07:56:53 GMT</pubDate>
            <atom:updated>2026-11-24T07:57:23.010Z</atom:updated>
            <content:encoded><![CDATA[<p><em>What I learned from a blank headset screen, and the exact Development build workflow that got my XR Template running in Unreal Engine 5.8.4.</em></p><p>My app installed. Xcode said it was running. I put on the Vision Pro and saw no scene. I kept rebuilding because I treated “the app launched” and “Unreal is rendering the level” as the same milestone. Once I checked them separately, I found two places where startup stopped.</p><p>Here is the order that helped me debug it: the app opens → Unreal starts → the map loads → the XR session becomes visible → I can see the scene in the headset. Each step gives me a different log message to look for.</p><p>This walkthrough uses my C++ project, PrettiestThing, and the XR Template that shipped with the engine. If you are opening Unreal for the first time, start with the editor and project structure primer. Come back here for the first headset build.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QIJYVSgE3-SyMTo_dcvwUQ.png" /><figcaption>PrettiestThing running in full immersion on Apple Vision Pro.</figcaption></figure><h3>1. Tested environmentlink</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mCQgIMnnBsXbmHAe67mdNw.png" /></figure><p>Engine directory used:</p><pre>yourpath/UE_5.8/Engine</pre><p>Project directory used:</p><pre>yourpath/Unreal/Projects/PrettiestThing</pre><p>I tried the GitHub source route while troubleshooting. My successful headset build came from the Launcher installation above. That is the engine I use for the steps here.</p><h3>2. What caused the blank app in this caselink</h3><p>I followed the device log and found two separate problems. Fixing the first gave me enough log output to diagnose the second.</p><h3>Blocker A: Unreal startup did not run automaticallylink</h3><p>The visionOS app opened its SwiftUI interface, then the log stopped before Unreal initialized. SwiftUI is the Apple-side shell that launches the app. Unreal’s GameThread runs gameplay and engine startup. I checked the debugger and initially saw no GameThread at all.</p><p>I called StartGameThread manually in LLDB, Xcode’s debugger. The thread appeared and then waited for the startup inputs Unreal expected, including command-line readiness and app activation. That experiment helped me locate the stall. The repeatable fix below starts the engine from a normal Home View launch.</p><p>The installed engine source moves startup from IOSAppDelegate to IOSSceneDelegate when scene lifecycle is enabled. The visionOS app uses SwiftUI scenes. These observations were consistent with SwiftUI scene startup bypassing the native scene-delegate startup path. That gave me a project-specific lifecycle hypothesis. The successful run used the toolchain in the table above.</p><p>I added a small Objective-C++ startup file to my project. It waits for an active app and a visible foreground window, connects that window to the Unreal app delegate, prepares the command line, and starts the GameThread once. It defers to a GameThread that has already started.</p><h3>Blocker B: the visionOS OpenXR runtime plugin was disabledlink</h3><p>After the startup change I could see that Unreal reached the level. These were the lines I looked for:</p><pre>Game Engine Initialized.<br>LoadMap: /Game/XRFramework/Levels/L_XRTemplate?Name=Player<br>LoadMap Load map complete /Game/XRFramework/Levels/L_XRTemplate<br>Engine is initialized. Leaving FEngineLoop::Init()</pre><p>The screen was still blank. The same log reported:</p><pre>Failed to find OpenXR runtime loader.<br>Failed to initialize core functions.</pre><p>I had enabled OpenXR, the interface Unreal uses to talk to an XR runtime. My project was still missing OpenXRVisionOS, the plugin that supplies the platform integration on this installation. I enabled it, packaged again, and saw the XR Template on the headset. This is where I learned that a successfully loaded map and a visible XR session are separate checks.</p><h3>3. Prepare the projectlink</h3><ol><li>Use the working Launcher UE 5.8.4 installation with its VisionOS platform component installed.</li><li>Open the project using that engine. Keep the project associated with 5.8.</li><li>Ensure the project has a C++ game module. For a Blueprint-only project, add a basic C++ class through Unreal first so the project has Source//.Build.cs and a game Target.cs.</li><li>Save the intended map and set it as the Game Default Map in Project Settings → Maps &amp; Modes.</li><li>Use Development for this validation.</li><li>Connect and unlock the Vision Pro, enable its development workflow, and confirm Xcode recognizes it as a usable run destination.</li></ol><p>The working Target.cs already uses TargetType.Game, BuildSettingsVersion.V7, and includes PrettiestThing in ExtraModuleNames. It was not modified for this fix.</p><h3>4. Enable the runtime pluginslink</h3><p>In the project’s .uproject, retain existing plugins and include the following entries in the Plugins array:</p><pre>{<br>  &quot;Name&quot;: &quot;OpenXR&quot;,<br>  &quot;Enabled&quot;: true<br>},<br>{<br>  &quot;Name&quot;: &quot;OpenXRHandTracking&quot;,<br>  &quot;Enabled&quot;: true<br>},<br>{<br>  &quot;Name&quot;: &quot;OpenXRVisionOS&quot;,<br>  &quot;Enabled&quot;: true,<br>  &quot;SupportedTargetPlatforms&quot;: [&quot;VisionOS&quot;]<br>}</pre><p>This is an array fragment, not a complete .uproject file. OpenXRHandTracking was already enabled in the tested project; enabling it alone does not implement hand interaction.</p><p>The installed plugin descriptor is located at:</p><pre>Engine/Platforms/VisionOS/Plugins/Runtime/OpenXRVisionOS/OpenXRVisionOS.uplugin</pre><p>It loads the OXRVisionOS runtime module. Restart Unreal Editor after changing plugins so its state matches the project descriptor.</p><h3>5. Preserve the working full-immersion configurationlink</h3><p>The following is the actual Config/VisionOS/VisionOSEngine.ini from the working project:</p><p>Copy</p><pre>[/Script/Engine.RendererSettings]<br>;These settings are currently required for all visionOS projects.<br>vr.InstancedStereo=False<br>vr.MobileMultiView=False<br>xr.OpenXRAcquireMode=1<br>;MSAA ;Note these are the default settings, specified in DefaultEngine.ini and BaseDeviceProfiles.ini<br>;r.Mobile.XRMSAAMode=2<br>;r.Mobile.AntiAliasing=3<br>;r.AntiAliasingMethod=3<br>;MSAA END<br>;FXAA<br>;r.Mobile.XRMSAAMode=0 ; This is overridden in BaseDeviceProfile.ini for VisionPro.  It can be changed in VisionOSDeviceProfiles.ini for this project.<br>r.Mobile.AntiAliasing=1<br>r.AntiAliasingMethod=1<br>;FXAA END<br>;MIXED IMMERSION Enable these settings for .mixed immesion mode, aka passthrough, AR.<br>;Comment them all out and full immesion will be used.<br>;Note: You would also probably need to delete the skybox from the level, etc, so that you are not covering up all of the real world.<br>r.Mobile.PropagateAlpha=0<br>r.PostProcessing.PropagateAlpha=0<br>r.AlphaInvertPass=0<br>;Note: this could also be done in Editor-&gt;ProjectSettings-&gt;Platforms-&gt;visionOS-&gt;Immersive Space-&gt;ImmsersiveStyle to 1.<br>[/Script/VisionOSRuntimeSettings.VisionOSRuntimeSettings]<br>ImmersiveStyle=0<br>;MIXED IMMERSION END<br>[/Script/IOSRuntimeSettings.IOSRuntimeSettings]<br>bUseSceneBasedLifecycle=False</pre><p>ImmersiveStyle=0 selects Full in this version. Full immersion is the presentation style I wanted for a virtual room. The alpha settings are part of the working renderer configuration recorded below the config header. During troubleshooting I had also seen an AlphaInvertPass validation error involving SceneColor. I kept the renderer settings from the successful build as a baseline and used the later startup and session logs to find where the blank launch stopped.</p><p>The bUseSceneBasedLifecycle=False setting was already present during the successful test. Changing it alone had not fixed the precompiled engine. It is recorded here to preserve the tested baseline; the project bootstrap is what was observed starting GameThread automatically. Do not assume a config flag recompiles a prebuilt engine module.</p><h3>6. Add the project-local startup workaroundlink</h3><p>File in the tested project:</p><pre>Source/PrettiestThing/PrettiestVisionStartup.mm</pre><p>Create the file in your game module. The .mm extension lets this file use Unreal C++ and Apple’s Objective-C APIs together. The PLATFORM_VISIONOS guard limits the implementation to that target. If your app already starts Unreal normally and reaches the XR session, use that working startup path.</p><p>Before reading the code, follow the sequence: register for app and window notifications, give normal startup a chance, look for a visible window, then hand that window and startup parameters to Unreal. The checks keep the fallback from starting a second game thread.</p><pre>// Project-local workaround for SwiftUI scenes bypassing IOSSceneDelegate startup.<br>// Runs before UE module startup; no engine binaries or Swift objects are replaced.<br>#include &quot;CoreMinimal.h&quot;<br>#if PLATFORM_VISIONOS<br>#include &quot;IOS/IOSAppDelegate.h&quot;<br>#import &lt;UIKit/UIKit.h&gt;<br><br>@interface PrettiestVisionStartup : NSObject<br>+ (void)tryStart;<br>@end<br>@implementation PrettiestVisionStartup<br>+ (void)load<br>{<br>    @autoreleasepool<br>    {<br>        NSLog(@&quot;[PrettiestLifecycle v1] bootstrap linked&quot;);<br>        for (NSNotificationName name in @[UIApplicationDidBecomeActiveNotification,<br>                                          UISceneDidActivateNotification,<br>                                          UIWindowDidBecomeVisibleNotification])<br>        {<br>            [[NSNotificationCenter defaultCenter] addObserverForName:name object:nil<br>                queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) {<br>                    // Allow the normal scene delegate to finish first.<br>                    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 250 * NSEC_PER_MSEC),<br>                        dispatch_get_main_queue(), ^{ [self tryStart]; });<br>                }];<br>        }<br>    }<br>}<br>+ (void)tryStart<br>{<br>    static bool StartedOrAlreadyRunning = false;<br>    if (StartedOrAlreadyRunning) return;<br>    IOSAppDelegate *delegate = [IOSAppDelegate GetDelegate];<br>    UIApplication *application = [UIApplication sharedApplication];<br>    if (!delegate) return;<br>    if (delegate.bHasStarted)<br>    {<br>        StartedOrAlreadyRunning = true;<br>        NSLog(@&quot;[PrettiestLifecycle v1] native GameThread already started; no intervention&quot;);<br>        return;<br>    }<br>    if (application.applicationState != UIApplicationStateActive || delegate.bIsSuspended)<br>    {<br>        NSLog(@&quot;[PrettiestLifecycle v1] awaiting active application (state=%ld suspended=%d)&quot;,<br>              (long)application.applicationState, delegate.bIsSuspended);<br>        return;<br>    }<br>    UIWindow *window = nil;<br>    for (UIScene *scene in application.connectedScenes)<br>    {<br>        if (scene.activationState != UISceneActivationStateForegroundActive ||<br>            ![scene isKindOfClass:[UIWindowScene class]]) continue;<br>        for (UIWindow *candidate in ((UIWindowScene *)scene).windows)<br>        {<br>            if (!candidate.hidden) { window = candidate; break; }<br>        }<br>        if (window) break;<br>    }<br>    if (!window) return;<br>    StartedOrAlreadyRunning = true;<br>    delegate.Window = window;<br>    FAppEntry::PreInit(delegate, application);<br>    if (!delegate.bCommandLineReady) [delegate NoUrlCommandLine];<br>    NSLog(@&quot;[PrettiestLifecycle v1] active SwiftUI window ready; starting GameThread once&quot;);<br>    [delegate StartGameThread];<br>}<br>@end<br>#endif</pre><p>The bootstrap registers before Unreal’s normal game-module startup. This matters because code in a module’s StartupModule would run too late to solve an engine startup deadlock.</p><p>The 250 ms dispatch delay lets normal scene callbacks finish first. This is the tested workaround’s timing, not an OS guarantee. Its static flag prevents its own repeated startup calls, while bHasStarted allows it to defer to normal engine startup. Re-test the workaround when upgrading the engine, especially around app activation and scene reopening.</p><p>In Source/PrettiestThing/PrettiestThing.Build.cs, add this inside the module constructor:</p><pre>if (Target.Platform == UnrealTargetPlatform.VisionOS)<br>{<br>    PrivateDependencyModuleNames.Add(&quot;ApplicationCore&quot;);<br>}</pre><p>ApplicationCore provides the IOSAppDelegate interface used by the bootstrap. Existing Core, CoreUObject, Engine, and InputCore dependencies remain in the project.</p><p>For a different project, use that project’s module directory and Build.cs. The bootstrap’s Objective-C class name must be unique within the app if copying it into multiple modules.</p><h3>7. Configure signing in Unreallink</h3><p>In Project Settings -&gt; Platforms -&gt; Xcode Projects:</p><ol><li>Set Apple Dev Account Team ID to the development team’s actual Team ID.</li><li>Set a bundle identifier/prefix belonging to that development setup. The local test used com.YourCompany.PrettiestThing; replace this for your own project.</li><li>Ensure Xcode has the matching account and can create/use a development signing profile for the headset.</li></ol><p>Persist the team in Unreal settings because packaging generates another Xcode project. A team selected only in an older generated workspace may not carry into packaging.</p><h3>8. Build, cook, stage, and packagelink</h3><p>I used Unreal’s built-in AutomationTool on Mac. RunUAT.sh comes with the engine and BuildCookRun is the operation I ask it to run. I pass the project path and target as arguments. In this command, -build compiles the game, -cook prepares assets for visionOS, -stagecollects the files, and -package produces the installable app. Set the two paths to your own folders before running it.</p><pre>ENGINE_ROOT=&quot;/yourpath/Unreal/Projects/UE_5.8&quot;<br>PROJECT_ROOT=&quot;/yourpath/Unreal/Projects/PrettiestThing&quot;</pre><pre>bash &quot;$ENGINE_ROOT/Engine/Build/BatchFiles/RunUAT.sh&quot; BuildCookRun \<br>  -nop4 -utf8output -nocompileeditor -skipbuildeditor \<br>  -cook \<br>  -project=&quot;$PROJECT_ROOT/PrettiestThing.uproject&quot; \<br>  -target=PrettiestThing \<br>  -platform=VisionOS -installed \<br>  -stage -package -build -pak -iostore -compressed \<br>  -clientconfig=Development -nocompile -nocompileuat</pre><p>Adapt the paths and target name if using another project. The -nocompile/-nocompileuat flags reuse the installed automation tooling; -build still requests the game build.</p><p>The recorded run ended with:</p><pre>Finalized .../Binaries/VisionOS/PrettiestThing.app for running fully self-contained<br>BUILD SUCCESSFUL<br>AutomationTool exiting with ExitCode=0 (Success)</pre><p>It took about 93 seconds in this particular run; that duration is not a general estimate.</p><p>Packaged app:</p><pre>/yourpath/Unreal/Projects/PrettiestThing/Binaries/VisionOS/PrettiestThing.app</pre><h3>Why a successful UBT build alone was insufficientlink</h3><p>I first used Unreal’s Build.sh and got a successful compile and link. When I tried to install that bundle, the headset rejected it. Its Info.plist, the bundle’s metadata file, was missing UIDeviceFamily. The packaging workflow runs Xcode finalization and includes cooked data. That gave me a bundle the headset accepted.</p><p>For later changes, I usually save, package, install the new app, and open it. When I add new source or change targets, I refresh the generated workspace if I need it in Xcode. I use Xcode Run when I need breakpoints. What to do after each type of edit</p><p>For this visionOS package, the finalized Info.plist contained UIDeviceFamily with value 7. Let Xcode’s platform settings generate it rather than manually patching a signed app.</p><h3>9. Install and launch on Vision Prolink</h3><p>Once the package exists, I install the .app and can open it from Home View. I use the following terminal commands when I want to install and capture launch output in one workflow. Start by listing available devices.</p><pre>xcrun devicectl list devices</pre><p>Choose the physical Vision Pro identifier shown on your Mac. With the headset connected and unlocked:</p><pre>VISION_DEVICE=&quot;YOUR_VISION_PRO_IDENTIFIER&quot;<br>PROJECT_ROOT=&quot;/yourpath/Unreal/Projects/PrettiestThing&quot;<br><br>xcrun devicectl device install app \<br>  --device &quot;$VISION_DEVICE&quot; \<br>  &quot;$PROJECT_ROOT/Binaries/VisionOS/PrettiestThing.app&quot;</pre><p>Launch and stream console output:</p><pre>xcrun devicectl device process launch \<br>  --device &quot;$VISION_DEVICE&quot; \<br>  --terminate-existing --console \<br>  com.YourCompany.PrettiestThing</pre><p>Use your actual bundle identifier. — terminate-existing closes an existing instance of that app. — console keeps the terminal attached while the process runs.</p><p>Alternatively, run the PrettiestThing scheme from the project’s VisionOS Xcode workspace with the physical headset selected, after preparing the self-contained package. The developer’s successful confirmation included Xcode runtime output.</p><p>If the headset is unavailable or devicectl returns CoreDevice 4016, reconnect/unlock it and check Xcode → Window → Devices and Simulators. That error prevented installation during this session; it did not indicate a new compilation failure.</p><h3>10. Verify each milestonelink</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HP0eWVeI4XIzxQ0o-ncs_g.png" /></figure><p>The supplied successful log includes:</p><pre>[PrettiestLifecycle v1] bootstrap linked<br>[PrettiestLifecycle v1] active SwiftUI window ready; starting GameThread once<br>...<br>Engine is initialized. Leaving FEngineLoop::Init()<br>...<br>FOXRVisionOSSession XR_SESSION_STATE_READY -&gt; XR_SESSION_STATE_SYNCHRONIZED<br>FOXRVisionOSSession XR_SESSION_STATE_SYNCHRONIZED -&gt; XR_SESSION_STATE_VISIBLE<br>FOXRVisionOSSession XR_SESSION_STATE_VISIBLE -&gt; XR_SESSION_STATE_FOCUSED</pre><p>A build succeeding proves compilation and packaging. I checked the final result by wearing the headset and looking for the XR Template scene.</p><h3>Retrieve the engine log when the Xcode console is incompletelink</h3><p>The tested app wrote its engine log inside its app data container at:</p><pre>Documents/PrettiestThing/Saved/Logs/PrettiestThing.log</pre><p>Retrieve it with:</p><pre>xcrun devicectl device copy from \<br>  --device &quot;$VISION_DEVICE&quot; \<br>  --domain-type appDataContainer \<br>  --domain-identifier com.YourCompany.PrettiestThing \<br>  --source Documents/PrettiestThing/Saved/Logs/PrettiestThing.log \<br>  --destination /tmp/PrettiestThing-device.log</pre><h3>11. Warnings and limits that remainlink</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*074Md6jz95A0RiAq3qZsvg.png" /></figure><p>Next interaction work is a separate milestone: validate joint tracking on-device, add supported input/action bindings or joint-based interaction, then implement fingertip touch and pinch/grab/release. A visible VR template does not establish those capabilities.</p><h3>12. What to preserve and how to roll backlink</h3><p>Keep these project files in source control or a backup:</p><ul><li>PrettiestThing.uproject with OpenXRVisionOS enabled.</li><li>Source/PrettiestThing/PrettiestVisionStartup.mm.</li><li>Source/PrettiestThing/PrettiestThing.Build.cs with ApplicationCore.</li><li>Config/VisionOS/VisionOSEngine.ini and the map/signing configuration used for the test.</li></ul><p>I edited SwiftMain.swift under Engine Source while trying to prove my change was running. My test log marker never appeared in the Launcher build. Refreshing the workspace regenerated the Xcode files, while the installed engine module remained precompiled. Putting the fallback in my game module let me rebuild it with the app.</p><p>To remove only the startup workaround after an engine update, remove PrettiestVisionStartup.mm and keep ApplicationCore if your game uses it elsewhere, as PrettiestThing’s Chapter 10 spatial input bridge does, then rebuild and verify automatic engine startup. Keep OpenXRVisionOS enabled for this visionOS runtime path.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1c780f771dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Control a distant cube with a pinch remote in Unreal Engine 5.8 on Vision Pro]]></title>
            <link>https://medium.com/@bennyfathurr/control-a-distant-cube-with-a-pinch-remote-in-unreal-engine-5-8-on-vision-pro-ff97876e1f65?source=rss-65219fc42daa------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff97876e1f65</guid>
            <category><![CDATA[unreal-engine]]></category>
            <category><![CDATA[spatial-development]]></category>
            <category><![CDATA[apple-vision-pro]]></category>
            <category><![CDATA[hand-tracking]]></category>
            <category><![CDATA[unreal-engine-5]]></category>
            <dc:creator><![CDATA[Benny Fathurrahman]]></dc:creator>
            <pubDate>Tue, 24 Nov 2026 05:35:11 GMT</pubDate>
            <atom:updated>2026-11-24T05:35:39.125Z</atom:updated>
            <content:encoded><![CDATA[<p>Chapter : 09</p><p>I used the same pinch recognizer to build a remote control with two horizontal axes.</p><p>What you will see. An orange sphere stays close enough to grab. A separate purple cube farther away copies the sphere’s left, right, forward and backward movement.</p><p>New word. Projection onto a plane here means keeping horizontal motion and discarding height changes. Use world up as the plane normal.</p><h3>1. Give the remote and its output separate originslink</h3><p>The orange sphere is a handheld remote. The purple cube starts 75 cm farther forward and 24 cm lower than the remote. It moves through its world transform with no rigid body or collision.</p><h3>2. Acquire and move the remotelink</h3><ol><li>Open either hand, then pinch near the sphere. One hand owns the remote at a time.</li><li>Drag left, right, forward, or back. The remote projects pinch motion onto the horizontal plane. Both objects receive the same horizontal displacement, limited to 20 cm from their respective starting positions.</li><li>Release to keep both objects at their last positions. Loss of tracking cancels ownership. Pinching again preserves the initial grip offset to avoid jumping.</li></ol><p>The sphere starts 22 cm to the right of the practice cube. On pinch begin, accept it within 4.5 cm of the pinch midpoint. Store SliderGripOffset = SliderTravel - ProjectOntoPlane(PinchCenter - SliderOrigin), where the projection is Unreal&#39;s FVector::VectorPlaneProject with world up as its normal. Each frame, add the stored offset back to the projected displacement before clamping it. The same travel vector is added to both origins. This preserves the original separation between remote and cube.</p><pre>const double Limit = 20.0 * UnitsPerCm;<br>			SliderTravel = (FVector::VectorPlaneProject(PinchCenter - SliderOrigin, FVector::UpVector)<br>				+ SliderGripOffset).GetClampedToMaxSize(Limit);<br>			SliderHandle-&gt;SetWorldLocation(SliderOrigin + SliderTravel);<br>			SliderCube-&gt;SetWorldLocation(SliderCubeOrigin + SliderTravel);</pre><p>Test all four directions and re-grab from the new position. Check that vertical hand motion leaves both heights unchanged.</p><h3>What the offset solveslink</h3><p>Imagine pinching at the edge of the sphere. Without the stored offset, its center would jump to your fingers on pickup. On the first held frame, the projected hand displacement and the value subtracted at acquisition cancel each other, leaving the previous travel. Both objects then move by the same amount from their own starting positions.</p><h3>Acquire the sphere and remember the grip offsetlink</h3><p>Run this in the per-hand update after computing PinchCenter and before applying SliderTravel. Only a fresh pinch near the sphere can acquire it. Clearing the owner leaves both objects at their previous positions.</p><pre>if (SliderOwner == ThisHand &amp;&amp; !Pinch.bActive)<br>{<br>    SliderOwner = EGrabOwner::None;<br>    UE_LOG(LogTemp, Display, TEXT(&quot;HandLab: %s slider %s&quot;), Side,<br>        bUsable ? TEXT(&quot;release&quot;) : TEXT(&quot;cancel&quot;));<br>}<br>if (bTargetPlaced &amp;&amp; Pinch.bActive &amp;&amp; !bWasPinching &amp;&amp;<br>    SliderOwner == EGrabOwner::None &amp;&amp; GrabOwner != ThisHand &amp;&amp;<br>    FVector::DistSquared(PinchCenter, SliderHandle-&gt;GetComponentLocation()) &lt;=<br>        FMath::Square(4.5 * UnitsPerCm))<br>{<br>    SliderOwner = ThisHand;<br>    SliderGripOffset = SliderTravel - FVector::VectorPlaneProject(PinchCenter - SliderOrigin, FVector::UpVector);<br>    UE_LOG(LogTemp, Display, TEXT(&quot;HandLab: %s slider begin&quot;), Side);<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fsQ8x7TProIand0pSL7GuA.png" /><figcaption>Before Drag</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_niDXatpE4L-s1tfthMLsw.png" /><figcaption>After Drag</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff97876e1f65" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hold and release a physics cube in Unreal Engine 5.8 on Vision Pro]]></title>
            <link>https://medium.com/@bennyfathurr/hold-and-release-a-physics-cube-in-unreal-engine-5-8-on-vision-pro-90adc20c3df2?source=rss-65219fc42daa------2</link>
            <guid isPermaLink="false">https://medium.com/p/90adc20c3df2</guid>
            <category><![CDATA[unreal-engine-5]]></category>
            <category><![CDATA[unreal-engine]]></category>
            <category><![CDATA[hand-gesture]]></category>
            <category><![CDATA[spatial-development]]></category>
            <category><![CDATA[apple-vision-pro]]></category>
            <dc:creator><![CDATA[Benny Fathurrahman]]></dc:creator>
            <pubDate>Tue, 24 Nov 2026 04:25:30 GMT</pubDate>
            <atom:updated>2026-11-24T04:25:30.727Z</atom:updated>
            <content:encoded><![CDATA[<p>Chapter : 08</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tjyJk9M0O0k0OPUFtoCbCw.png" /></figure><p>I wanted to carry a cube with my palm open. I first gave the practice cube gravity and a tray, then added collision that follows each palm.</p><p>What you will see. The cube drops with gravity after a pinch. You can also let it rest on a flat open palm and carry it without pinching.</p><p>New words. A physics body is an object the physics simulation can move. A collider is the shape it uses for contact. Unreal gives the cube its own collision and uses a separate invisible box to approximate the palm.</p><h3>1. Give the cube a physics body and a place to landlink</h3><p>The practice cube has simple collision from Unreal’s Basic Shapes cube mesh. Its object type is PhysicsBody, it blocks world geometry that reciprocates, and it still blocks HandInteract for touch and grab queries. A tray below the spawn position catches the cube at the start and when released above it.</p><h3>2. Hand off between pinch control and simulationlink</h3><ol><li>Open the hand, then pinch near the cube. Acquisition uses the existing 5 cm HandInteract query.</li><li>One hand owns the cube. While held, simulation pauses and the cube moves toward a grip point between the palm and pinch midpoint, weighted toward the pinch. Its rotation follows the palm. The move requests a collision sweep so blocking geometry can limit translation.</li><li>Open the pinch. Simulation resumes with zero initial linear and angular velocity. Gravity takes over, and the cube can land on the tray.</li><li>Losing tracking also releases the cube. To pick it up again, open the hand and start a fresh pinch.</li></ol><p>Try both hands. Verify the cube starts on the tray, turns cyan on pickup, follows as you lift and rotate your hand, then drops and lands. Check that the other hand cannot take ownership while it is held. The glove is a visual model. The pinch controls the object through a grip point, so the fingers do not physically squeeze the collider.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QF5Y6Tryi-M6rm96scqg-g.png" /></figure><p>The physics version is based on Part 7’s verified grab.</p><h3>3. Build the palm colliderlink</h3><p>Each hand has a movable box collider aligned to the wrist and knuckles, independent of the glove mesh. The cube stays simulated and contacts the collider directly. Tracking loss or pinch ownership disables the palm colliders. The practice tray is the starting platform. For the first test, lift the cube just above your other palm and release the pinch. Keep the receiving palm flat, move it slowly without pinching, then tilt it to let the cube slide off. The approximate collider also responds when the back of the hand contacts the cube.</p><p>In AVisualizeHand::Tick, update both UBoxComponent supports after resolving pinch ownership. Reuse the wrist-to-knuckles frame from the gloves. Place the collider 62% of the way from the wrist to the knuckle midpoint. The box has 4.3 cm forward and 0.9 cm vertical half-extents. Its lateral half-extent is 64% of the knuckle span, clamped to 2.8–5 cm. Set it to block PhysicsBody and let the cube block its WorldDynamic object type. Disable collision for invalid tracking and temporarily disable it for jumps over 12 cm before moving the support.</p><pre>const FVector Center = FMath::Lerp(Wrist, (Index + Little) * 0.5, 0.62);<br>		const bool bHadCollision = Support.GetCollisionEnabled() != ECollisionEnabled::NoCollision;<br>		const bool bJumped = FVector::DistSquared(Center, Support.GetComponentLocation()) &gt;<br>			FMath::Square(12.0 * UnitsPerCm);<br>		if (bJumped)<br>		{<br>			Support.SetCollisionEnabled(ECollisionEnabled::NoCollision);<br>		}<br>		const FVector Extent(4.3 * UnitsPerCm,<br>			FMath::Clamp(FVector::Distance(Index, Little) * 0.64, 2.8 * UnitsPerCm, 5.0 * UnitsPerCm),<br>			0.9 * UnitsPerCm);</pre><p>The held grip uses Lerp(PalmPosition, PinchCenter, 0.75). The palm support has its own transform and is active when the cube has no pinch owner. This is what lets the cube remain simulated on an open hand.</p><p>I confirmed the open-palm carry in the installed Vision Pro build.</p><h3>Test the two forms of carry separatelylink</h3><p>First release the cube over the tray and check that gravity takes over. Then release it above a flat receiving palm and move that hand slowly. Tilt the palm to let the cube slide off. If it falls through the palm, check that the palm allows physics collision, the cube has resumed simulation, and the two object types block each other.</p><h3>Switch simulation on pickup and releaselink</h3><p>In the cumulative VisualizeHand.cpp, use the following block after checking the palm rotation. The successful overlap disables simulation before the game moves the cube. When the grip ends, the release block restores simulation and clears velocity so the cube starts falling under gravity.</p><pre>if (GrabOwner == ThisHand &amp;&amp; !bCanDriveGrab)<br>{<br>    GrabOwner = EGrabOwner::None;<br>    ReachTarget-&gt;SetSimulatePhysics(true);<br>    ReachTarget-&gt;SetPhysicsLinearVelocity(FVector::ZeroVector);<br>    ReachTarget-&gt;SetPhysicsAngularVelocityInRadians(FVector::ZeroVector);<br>    UE_LOG(LogTemp, Display, TEXT(&quot;HandLab: %s grab %s&quot;), Side,<br>        bUsable &amp;&amp; !Pinch.bActive ? TEXT(&quot;release&quot;) : TEXT(&quot;cancel&quot;));<br>}<br>if (bCanDriveGrab)<br>{<br>    const FVector PalmPosition = State.HandKeyLocations[Palm];<br>    const FVector GripCenter = PalmPosition.ContainsNaN()<br>        ? PinchCenter : FMath::Lerp(PalmPosition, PinchCenter, 0.75);<br>    const FQuat GripRotation = PalmRotation.GetNormalized();<br>    if (bTargetPlaced &amp;&amp; !bWasPinching &amp;&amp; GrabOwner == EGrabOwner::None &amp;&amp; SliderOwner != ThisHand)<br>    {<br>        TArray&lt;FOverlapResult&gt; Candidates;<br>        GetWorld()-&gt;OverlapMultiByChannel(Candidates, PinchCenter, FQuat::Identity,<br>            ECC_GameTraceChannel2, FCollisionShape::MakeSphere(5.0 * UnitsPerCm));<br>        if (Candidates.ContainsByPredicate([this](const FOverlapResult&amp; Hit)<br>        {<br>            return Hit.GetComponent() == ReachTarget;<br>        }))<br>        {<br>            ReachTarget-&gt;SetSimulatePhysics(false);<br>            GrabOwner = ThisHand;<br>            UE_LOG(LogTemp, Display, TEXT(&quot;HandLab: %s grab begin&quot;), Side);<br>        }<br>    }<br>    if (GrabOwner == ThisHand)<br>    {<br>        ReachTarget-&gt;SetWorldLocationAndRotation(<br>            GripCenter, GripRotation, true, nullptr, ETeleportType::TeleportPhysics);<br>    }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90adc20c3df2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Grabbing a virtual cube with a pinch in Unreal Engine 5.8 on Vision Pro]]></title>
            <link>https://medium.com/@bennyfathurr/grabbing-a-virtual-cube-with-a-pinch-in-unreal-engine-5-8-on-vision-pro-7fe83485fe8f?source=rss-65219fc42daa------2</link>
            <guid isPermaLink="false">https://medium.com/p/7fe83485fe8f</guid>
            <category><![CDATA[apple-vision-pro]]></category>
            <category><![CDATA[unreal-engine-5]]></category>
            <category><![CDATA[spatial-development]]></category>
            <category><![CDATA[unreal-engine]]></category>
            <category><![CDATA[hand-gesture]]></category>
            <dc:creator><![CDATA[Benny Fathurrahman]]></dc:creator>
            <pubDate>Tue, 24 Nov 2026 03:38:38 GMT</pubDate>
            <atom:updated>2026-11-24T03:38:38.925Z</atom:updated>
            <content:encoded><![CDATA[<p>Chapter : 07</p><p>My first grab demo used a query-only cube. I wanted to move it with either hand, keep its pickup offset, and leave it in place on release. I confirmed this milestone on Vision Pro. The current project includes Part 8, which changes the grip pose and restores simulation on release.</p><p>What you will see. Pinch beside the cube and the same hand can move it. When that hand releases, it gives up control.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bInvjvBa9-tptK8RvRwCrg.png" /><figcaption>Intercation Pinch</figcaption></figure><p>New words. An owner here is the hand currently allowed to move the cube. A grip transformdescribes the position and rotation of the point that carries it.</p><h3>1. Find the target on the pinch-begin framelink</h3><p>Use the midpoint from Part 6. On the rising edge, overlap a 5 cm sphere on HandInteract. Accept the practice cube only if the overlap includes it, the hand has a usable palm rotation, and no hand owns it. The current source names the owner states None, Left, and Right.</p><h3>2. Store the offset and drive the holdlink</h3><p>For the original milestone, build a grip transform from the palm rotation and pinch midpoint. On pickup, store the cube transform relative to the grip using CubeWorld.GetRelativeTransform(GripWorld). During the hold, compose that stored transform with the current grip, using CubeRelative * GripWorld in Unreal. Updating from that offset avoids snapping to the midpoint on pickup.</p><h3>3. Release ownershiplink</h3><p>On pinch end or tracking loss, clear the owner. The original query-only cube stays at its last world transform. The current actor applies Part 8 physics here, so its cube falls on release.</p><p>To test, begin pinching beside the cube, move and rotate your hand, then release. Try to take the cube with your other hand during the hold. Watch for grab begin, grab release, or grab cancel.</p><h3>Read the transform mathlink</h3><pre>// At pickup, express the cube relative to the grip.<br>CubeRelative = CubeWorld.GetRelativeTransform(GripWorld);<br><br>// During the hold, place that same offset at the current grip.<br>const FTransform DesiredWorld = CubeRelative * CurrentGripWorld;</pre><p>This is the transform portion of the original Part 7 workflow. The current project drives the later weighted grip point from Chapter 8. For the offset version, try grabbing near one corner. The cube should keep that corner near the pickup point as you move.</p><h3>Recreate the query-only pickup looplink</h3><p>This excerpt reconstructs the earlier milestone using the current lab’s types. Keep GrabOwnerand CubeRelative as Actor members, initialized to EGrabOwner::None and FTransform::Identity. Run it per hand after computing PinchCenter, bWasPinching, and bCanDriveGrab (active pinch and usable palm rotation). The target must already exist with query collision.</p><pre>if (GrabOwner == ThisHand &amp;&amp; !bCanDriveGrab)<br>{<br>    GrabOwner = EGrabOwner::None;<br>}<br>if (bCanDriveGrab &amp;&amp; bTargetPlaced)<br>{<br>    const FTransform GripWorld(PalmRotation.GetNormalized(), PinchCenter);<br>    if (!bWasPinching &amp;&amp; GrabOwner == EGrabOwner::None)<br>    {<br>        TArray&lt;FOverlapResult&gt; Candidates;<br>        GetWorld()-&gt;OverlapMultiByChannel(<br>            Candidates, PinchCenter, FQuat::Identity, ECC_GameTraceChannel2,<br>            FCollisionShape::MakeSphere(5.0 * UnitsPerCm));<br>        if (Candidates.ContainsByPredicate([this](const FOverlapResult&amp; Hit)<br>            { return Hit.GetComponent() == ReachTarget; }))<br>        {<br>            GrabOwner = ThisHand;<br>            CubeRelative = ReachTarget-&gt;GetComponentTransform().GetRelativeTransform(GripWorld);<br>        }<br>    }<br>    if (GrabOwner == ThisHand)<br>    {<br>        ReachTarget-&gt;SetWorldTransform(CubeRelative * GripWorld);<br>    }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7fe83485fe8f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Recognizing a thumb–index pinch from tracked hand joints in Unreal Engine 5.8 on Vision Pro]]></title>
            <link>https://medium.com/@bennyfathurr/recognizing-a-thumb-index-pinch-from-tracked-hand-joints-in-unreal-engine-5-8-on-vision-pro-283fd0e9c6ee?source=rss-65219fc42daa------2</link>
            <guid isPermaLink="false">https://medium.com/p/283fd0e9c6ee</guid>
            <category><![CDATA[unreal-engine]]></category>
            <category><![CDATA[apple-vision-pro]]></category>
            <category><![CDATA[spatial-development]]></category>
            <category><![CDATA[unreal-engine-5]]></category>
            <dc:creator><![CDATA[Benny Fathurrahman]]></dc:creator>
            <pubDate>Tue, 24 Nov 2026 03:36:00 GMT</pubDate>
            <atom:updated>2026-11-24T03:36:00.627Z</atom:updated>
            <content:encoded><![CDATA[<p>Chapter : 06</p><p>For my grab input, I measured the world-space distance between ThumbTip and IndexTip. I ran the recognizer once per hand and drew a yellow marker at the midpoint while a pinch was active. I confirmed this on Vision Pro before connecting it to the cube.</p><p>What you will see. A yellow dot appears between your thumb and index finger when they pinch. The same dot later becomes the point used to pick up objects.</p><p>Where to work. Add the recognizer state to VisualizeHand.h. In VisualizeHand.cpp, update it inside the existing per-hand loop and set the marker in the same update.</p><h3>1. Read the tips and maintain per-hand statelink</h3><p>Use a separate FPinchState per side. It starts inactive with bNeedsOpen true. Feed it the same valid tracked sample used for touch. Check both tip positions and make sure UnitsPerCm is positive.</p><h3>2. Apply hysteresislink</h3><p>Observe at least 3 cm of separation before accepting a pinch. Close at 2 cm or less and stay pinched until the distance reaches 3 cm. The gap prevents jitter around one threshold from repeatedly opening and closing the pinch.</p><pre>if (!bUsable)<br>		{<br>			Pinch = FPinchState{};<br>		}<br>		else<br>		{<br>			const double Distance = FVector::Distance(Thumb, IndexTip);<br>			if (Pinch.bNeedsOpen)<br>			{<br>				Pinch.bNeedsOpen = Distance &lt; 3.0 * UnitsPerCm;<br>			}<br>			else<br>			{<br>				Pinch.bActive = bWasPinching ? Distance &lt; 3.0 * UnitsPerCm : Distance &lt;= 2.0 * UnitsPerCm;<br>			}<br>		}</pre><h3>3. Show the state and test the edgeslink</h3><p>Set marker visibility from Pinch.bActive. Position it at (Thumb + IndexTip) * 0.5. Use the change from the previous active state to log begin, end, or cancel. Opening the pinch is a normal end. Losing the valid sample resets the state and requires an open hand to rearm.</p><p>On the headset, open, pinch, hold and release. The marker should stay visible through the hold and the log should show one begin. While pinched, move the hand out of tracking and bring it back closed. Open it before testing a fresh pinch.</p><h3>Trace the state with example distanceslink</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*va9iL__wqHPOpKSl39fwgg.png" /></figure><p>The two thresholds are hysteresis. They give a held pinch some room to move. The distances are project defaults and can be tuned after headset testing.</p><h3>Declare the pinch state and connect the markerlink</h3><p>In the Actor header, define the state under private: and keep one copy per hand. Pass the matching state and marker to the per-hand update lambda.</p><pre>struct FPinchState<br>{<br>    bool bActive = false;<br>    bool bNeedsOpen = true;<br>};<br><br>FPinchState LeftPinch;<br>FPinchState RightPinch;</pre><p>In the constructor, make one sphere per hand. Set its dynamic material’s Color to yellow in BeginPlay. After the recognizer runs in Tick, update the same marker by reference.</p><pre>Marker.SetVisibility(Pinch.bActive);<br>const FVector PinchCenter = (Thumb + IndexTip) * 0.5;<br>if (Pinch.bActive)<br>{<br>    Marker.SetWorldLocation(PinchCenter);<br>    Marker.SetWorldScale3D(FVector(0.018 * UnitsPerCm));<br>}</pre><p>The two thresholds are hysteresis. They give a held pinch some room to move. The distances are project defaults and can be tuned after headset testing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=283fd0e9c6ee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Touching a virtual object with an index fingertip in Unreal Engine 5.8 on Vision Pro]]></title>
            <link>https://medium.com/@bennyfathurr/touching-a-virtual-object-with-an-index-fingertip-in-unreal-engine-5-8-on-vision-pro-afd33df474a1?source=rss-65219fc42daa------2</link>
            <guid isPermaLink="false">https://medium.com/p/afd33df474a1</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[unreal-engine-5]]></category>
            <category><![CDATA[foundational]]></category>
            <category><![CDATA[unreal-engine]]></category>
            <category><![CDATA[apple-vision-pro]]></category>
            <dc:creator><![CDATA[Benny Fathurrahman]]></dc:creator>
            <pubDate>Mon, 23 Nov 2026 04:38:47 GMT</pubDate>
            <atom:updated>2026-11-23T08:17:30.752Z</atom:updated>
            <content:encoded><![CDATA[<p>Chapter : 05</p><p>I wanted to see when each finger was actually touching the practice cube. This demo uses the index tip on both hands. A contact is a query and a color change, so it works without a collider on the glove.</p><p>What you will see. The practice cube turns green when either index fingertip touches it and clears when both fingertips move away. This lesson adds visible feedback to Chapter 4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t6K3zNU3Q6yesScXJvWXMg.png" /></figure><p>New word. A sweep moves a test shape between two positions. An overlap checks one position. Together they distinguish a fingertip resting on the surface from a quick pass between frames.</p><h3>1. Track contact independently for each handlink</h3><p>Give each hand an FTouchState with bTouching, PreviousTip, and bHasPreviousTip. Read IndexTip in world space. Use a 1 cm sphere to enter contact and a 1.25 cm sphere while already touching. Check that the overlap includes ReachTarget; a different object blocking the channel should leave the cube state alone.</p><pre>const auto Shape = FCollisionShape::MakeSphere((bWasTouching ? 1.25 : 1.0) * UnitsPerCm);<br>				TArray&lt;FOverlapResult&gt; Hits;<br>				GetWorld()-&gt;OverlapMultiByChannel(Hits, Tip, FQuat::Identity, ECC_GameTraceChannel2, Shape);<br>				bTouching = Hits.ContainsByPredicate([this](const FOverlapResult&amp; Hit)<br>				{<br>					return Hit.GetComponent() == ReachTarget;<br>				});</pre><h3>2. Account for motion between sampleslink</h3><p>When neither endpoint is touching, sweep between the previous and current tip if the movement is 15 cm or less. Filter the sweep hit to the cube. The sweep reports fingertip crossed cubeseparately from a sustained contact. Clearing the previous tip on tracking loss prevents a sweep from stale data when the hand returns.</p><h3>3. Log transitions and combine the feedbacklink</h3><p>Log touch begin on contact, touch end on separation and touch cancel on tracking loss. Set the cube green if either hand touches it and white once both hands clear. In the later grab build, cyan takes priority while held.</p><p>I confirmed the cube-contact demo in PrettiestThing. To reproduce it, touch and withdraw with each index finger, then test both hands. The cube should stay green when one finger leaves while the other still touches it. A button with press depth would need another state driven by the contact.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kn4E6yvJA2gXOho3-Ox_Vg.png" /><figcaption>The Cube wont affected by another finger other than Point Finger</figcaption></figure><h3>Follow one finger across three frameslink</h3><ol><li>Outside the cube, the query has no matching hit. Save the tip position for the next frame.</li><li>At contact, the overlap contains ReachTarget. Set the left or right bTouching flag.</li><li>When the finger leaves, use the larger release radius first. Once that query clears, log the end and let the other hand’s flag decide whether the cube stays green.</li></ol><p>If a fast crossing logs but the cube stays white, that path detected motion between frames with no sustained contact at either endpoint.</p><h3>From the sweep to the visible statelink</h3><p>In the successful tip-read branch, after the overlap, sweep only when both endpoints are outside. Keep the previous position for the next frame.</p><pre>if (Touch.bHasPreviousTip &amp;&amp; !bWasTouching &amp;&amp; !bTouching &amp;&amp;<br>    FVector::DistSquared(Touch.PreviousTip, Tip) &lt;= FMath::Square(15.0 * UnitsPerCm))<br>{<br>    FHitResult Crossing;<br>    if (GetWorld()-&gt;SweepSingleByChannel(Crossing, Touch.PreviousTip, Tip,<br>        FQuat::Identity, ECC_GameTraceChannel2, Shape) &amp;&amp; Crossing.GetComponent() == ReachTarget)<br>    {<br>        UE_LOG(LogTemp, Display, TEXT(&quot;HandLab: %s fingertip crossed cube&quot;), Side);<br>    }<br>}<br>Touch.PreviousTip = Tip;<br>Touch.bHasPreviousTip = true;</pre><p>Once the tip branches have finished, compare and store the contact flag. Invalid tracking clears bHasPreviousTip before this block.</p><pre>if (bTouching != bWasTouching)<br>{<br>    UE_LOG(LogTemp, Display, TEXT(&quot;HandLab: %s touch %s&quot;), Side,<br>        bTouching ? TEXT(&quot;begin&quot;) : (Touch.bHasPreviousTip ? TEXT(&quot;end&quot;) : TEXT(&quot;cancel&quot;)));<br>}<br>Touch.bTouching = bTouching;</pre><p>After updating both hands, combine their flags. For a touch-only build, use this with the cube’s dynamic material. In the cumulative lab, the held state takes priority.</p><pre>const bool bIsTouched = LeftTouch.bTouching || RightTouch.bTouching;<br>if (TargetMaterial &amp;&amp; bWasTouched != bIsTouched)<br>{<br>    TargetMaterial-&gt;SetVectorParameterValue(TEXT(&quot;Color&quot;),<br>        bIsTouched ? FLinearColor::Green : FLinearColor::White);<br>}</pre><p>Capture bWasTouched from the same two flags before the per-hand updates.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=afd33df474a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Detecting hand proximity in Unreal Engine 5.8 on Vision Pro]]></title>
            <link>https://medium.com/@bennyfathurr/detecting-hand-proximity-in-unreal-engine-5-onvision-pro-b62c16b1d59a?source=rss-65219fc42daa------2</link>
            <guid isPermaLink="false">https://medium.com/p/b62c16b1d59a</guid>
            <category><![CDATA[unreal-engine-5]]></category>
            <category><![CDATA[unreal-engine]]></category>
            <category><![CDATA[spatial-development]]></category>
            <category><![CDATA[beginner]]></category>
            <category><![CDATA[apple-vision-pro]]></category>
            <dc:creator><![CDATA[Benny Fathurrahman]]></dc:creator>
            <pubDate>Mon, 23 Nov 2026 04:30:15 GMT</pubDate>
            <atom:updated>2026-11-23T08:15:44.282Z</atom:updated>
            <content:encoded><![CDATA[<p>Chapter : 04</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VvF-Cc4VPwLcBH3ZFJAolA.png" /></figure><p>A glove can follow my hand perfectly while objects still have no way to tell I am touching them. I began with a small cube and a query around each tracked index tip.</p><p><strong>What you will see.</strong> A practice cube appears within reach once tracking starts. The first version logs when an index finger moves close to it.</p><p>New words. Collision is the shape Unreal can test or simulate. An overlap query asks which collision shapes are in a small region. A trace channel lets us choose which objects answer that question. We named ours HandInteract.</p><h3>1. Define a trace channellink</h3><p>In Project Settings -&gt; Engine -&gt;Collision, create a trace channel called HandInteract with default response Ignore. In this project the resulting config slot is ECC_GameTraceChannel2. If a different project assigns another slot, use that slot in C++.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*61woGNSHzspxIMj1I5qDTA.png" /><figcaption>The HandInteract trace channel defaults to Ignore. The practice cube opts in by blocking this channel.</figcaption></figure><h3>2. Put the cube within reachlink</h3><p>In AVisualizeHand, create a movable Basic Shapes cube. Enable its query collision and block HandInteract. Wait for a valid tracked hand and valid XR position before placing the cube once. Use the player&#39;s yaw to position it 42 cm forward and 22 cm below the view. The cube is 8 cm across.</p><h3>3. Track the first interaction transitionlink</h3><p>In the original Part 4 build, test a 2 cm sphere around each valid IndexTip. Filter the overlap to the practice cube. Combine both results, and log only when the combined state changes. The recorded Development test showed repeated HandLab: fingertip proximity entered and cleared in the device log. The current project has the later Part 5 per-hand contact messages.</p><h3>4. Test on devicelink</h3><p>Approach the cube and withdraw with either index finger. If the live launch console only shows startup, copy Documents/PrettiestThing/Saved/Logs/PrettiestThing.log from the installed app&#39;s data container and search for HandLab:. Keep the cube in reach from the starting position. Full immersion can be interrupted by the system boundary. <a href="https://developer.apple.com/design/human-interface-guidelines/immersive-experiences">Apple’s immersive experience guidance</a></p><h3>Where the setup goeslink</h3><p>Set the cube’s collision response in the Actor constructor, then place it in Tick on the first usable tracking frame. For the original query-only milestone, the key setup is:</p><pre>ReachTarget-&gt;SetCollisionResponseToAllChannels(ECR_Ignore);<br>ReachTarget-&gt;SetCollisionResponseToChannel(ECC_GameTraceChannel2, ECR_Block);<br>ReachTarget-&gt;SetCollisionEnabled(ECollisionEnabled::QueryOnly);</pre><p>For the cumulative project, use the existing collision settings in VisualizeHand.cpp. Chapter 8 uses the same trace response and enables physics. In either version, place the cube before testing queries, and check that the channel in the project settings matches the one in C++.</p><h3>Recreate the original proximity querylink</h3><p>This reconstruction shows the Chapter 4 query-only milestone. Put the helper inside Tick after placing the cube and reading both hands. Pass in the world-space index position only for a usable tracked sample. Keep the previous combined result in a persistent Actor bool such as bWasNearCube, initialized to false.</p><pre>auto IsNearCube = [&amp;](const FVector&amp; Tip)<br>{<br>    TArray&lt;FOverlapResult&gt; Hits;<br>    GetWorld()-&gt;OverlapMultiByChannel(<br>        Hits, Tip, FQuat::Identity, ECC_GameTraceChannel2,<br>        FCollisionShape::MakeSphere(2.0 * UnitsPerCm));<br>    return Hits.ContainsByPredicate([this](const FOverlapResult&amp; Hit)<br>    {<br>        return Hit.GetComponent() == ReachTarget;<br>    });<br>};<br>const bool bNearCube = (bLeftTipValid &amp;&amp; IsNearCube(LeftTip)) ||<br>                       (bRightTipValid &amp;&amp; IsNearCube(RightTip));<br>if (bNearCube != bWasNearCube)<br>{<br>    UE_LOG(LogTemp, Display, TEXT(&quot;HandLab: fingertip proximity %s&quot;),<br>        bNearCube ? TEXT(&quot;entered&quot;) : TEXT(&quot;cleared&quot;));<br>    bWasNearCube = bNearCube;<br>}</pre><p>The current source uses the per-hand contact query in Chapter 5.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b62c16b1d59a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From tracked joints to a rigged virtual hand in Unreal Engine 5.8 on Vision Pro]]></title>
            <link>https://medium.com/@bennyfathurr/from-tracked-joints-to-a-rigged-virtual-hand-in-unreal-engine-5-8-for-vision-pro-bbb51dbacb66?source=rss-65219fc42daa------2</link>
            <guid isPermaLink="false">https://medium.com/p/bbb51dbacb66</guid>
            <category><![CDATA[unreal-engine-5]]></category>
            <category><![CDATA[spatial-technologies]]></category>
            <category><![CDATA[apple-vision-pro]]></category>
            <category><![CDATA[unreal-engine]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Benny Fathurrahman]]></dc:creator>
            <pubDate>Mon, 23 Nov 2026 04:17:17 GMT</pubDate>
            <atom:updated>2026-11-23T08:09:56.919Z</atom:updated>
            <content:encoded><![CDATA[<p>Chapter : 03</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o6HRz1jnKlyXoMej_yTRtw.png" /><figcaption>Hand Gloves with Manny XR Gloves</figcaption></figure><p>I used the left and right Manny XR gloves from the XR Template. The first visual pass aligned the hand as a whole. The second drove the finger segments so the gloves bent with my fingers.</p><p>What you will see. Two gloves follow the wrists and bend with the fingers. Leave the dots enabled during the first tests so you can see how closely the mesh follows the joints.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QF1zkFDfvketRxXb3j0gfQ.png" /><figcaption>The left Manny XR glove in Unreal’s Skeletal Mesh Editor, with the three index finger bones expanded in the Skeleton Tree.</figcaption></figure><p>New words. A skeletal mesh has bones that move the vertices of the model. A rest pose is the asset’s authored starting pose. Retargeting maps the motion from the tracked hand onto that mesh. Here I apply transforms directly through two poseable mesh components.</p><h3>Reproduce the glove buildlink</h3><ol><li>Load SKM_MannyXR_left and SKM_MannyXR_right from /Game/XRMannequins/Meshes. Use one UPoseableMeshComponent per side and disable collision.</li><li>Build the authored palm frame using the reference-pose origins of hand_l/r, index_01_l/r, and pinky_01_l/r. Build the tracked frame using Wrist, IndexProximal, and LittleProximal. In both frames, the wrist-to-knuckle-midpoint vector supplies forward and index-to-little supplies across.</li><li>Use TrackedFrame * RestFrame.Inverse() for world rotation. Subtract the rotated, scaled reference wrist from the tracked wrist for translation. This aligns the wrist even when the mesh origin sits elsewhere.</li><li>In UpdateFingers, reset each three-bone chain, determine its authored local segment directions, then apply a shortest-arc quaternion to align each bone to the corresponding tracked joint segment. Update parent first. The distal segment uses the authored distal direction estimate because the glove lacks a tip bone.</li><li>Keep the joint dots visible while testing. Verify left and right independently, turn both palms over, and flex each finger. I confirmed the gloves and their motion on Vision Pro.</li></ol><p>The tracking skeleton describes measured joint positions. The mesh skeleton controls vertex deformation. The mapping has to account for the rest pose, hierarchy, local axes, handedness and transform spaces. Keep the glove asset directory in the cook, as in the project’s packaging settings.</p><h3>Retargeting notes for other hand mesheslink</h3><p>The options below explain how to adapt the technique to a different rig. The tested Manny XR path uses the poseable meshes and per-segment rotation above.</p><h3>1. Choose what will drive the meshlink</h3><p>There are two initial approaches. A rotation-driven rig positions the wrist from tracking and rotates finger bones while preserving the mesh’s authored lengths. It tends to preserve the mesh shape but may not put every fingertip exactly at the tracked fingertip. A position-driven rig attempts to match all joint positions, often using IK. It can fit the tracked anatomy more closely but can stretch or compress an incompatible mesh.</p><p>Start with wrist placement plus finger rotations. Record fingertip error before adding scaling or IK. Otherwise, a change that fixes one finger may conceal a wrong rotation mapping on another.</p><h3>2. Define an asset contractlink</h3><p>For each hand asset, record:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nVucrCqWB1WR7MrvmXu6nQ.png" /></figure><p>Avoid a negative-scale mirror for the first implementation. It complicates quaternion and handedness reasoning. Use known left/right rigs and calibrate separately.</p><p>Example mapping sheet, to be filled with actual imported names:</p><pre>Wrist              → wrist_l<br>IndexMetacarpal    → index_metacarpal_l<br>IndexProximal      → index_01_l<br>IndexIntermediate  → index_02_l<br>IndexDistal        → index_03_l<br>IndexTip           → optional marker / IK target</pre><p>These mesh bone names are examples, not names provided by Unreal. A tip marker can serve as an IK target even when there is no skinned tip bone. Keep deformation-only bones at their reference pose until you deliberately drive them.</p><h3>3. Establish transform spaceslink</h3><p>Three spaces recur throughout this work:</p><ul><li>World space: where the returned Unreal joint is located in the level.</li><li>Mesh component space: relative to the SkeletalMeshComponent.</li><li>Bone local space: relative to the mesh bone’s parent.</li></ul><p>For a tracked transform JointWorld and a mesh component transform MeshWorld:</p><pre>const FTransform JointInComponent =<br>    JointWorld.GetRelativeTransform(MeshWorld);</pre><p>For a child’s target component-space transform and its mapped parent’s target:</p><pre>const FTransform ChildLocal =<br>    ChildInComponent.GetRelativeTransform(ParentInComponent);</pre><p>These fragments show conversion, not a complete retargeter. When the mesh hierarchy contains extra bones, the parent is the actual mesh parent; using the previous tracked joint blindly is incorrect. Nonuniform scale needs particular care because FTransform represents translation, quaternion rotation and scale rather than an arbitrary affine matrix.</p><h3>4. Calibrate the orientation offsetlink</h3><p>A tracked joint’s orientation convention usually differs from an imported bone. If you copy the quaternion directly, the finger may point sideways or twist.</p><p>In a matching reference pose, express both the mesh bone and tracked joint rotations in the same space. Using quaternion composition where A * B applies B then A:</p><pre>Q_offset = inverse(Q_tracking_reference) * Q_mesh_reference<br>Q_mesh_target = Q_tracking_current * Q_offset</pre><p>The offset is fixed for that mapping and reference pose. Confirm the convention experimentally: rotate only the wrist, then bend one finger. If the correction works only when the hand faces one direction, a space or multiplication-order error is likely.</p><p>Do not recalculate the offset from an arbitrary live pose every frame. That would absorb the movement you are trying to reproduce. Store calibration data per hand/rig, and normalize output quaternions.</p><h3>5. A practical Control Rig workflowlink</h3><ol><li>Import the skeletal mesh and inspect its reference skeleton.</li><li>Create a Control Rig for that skeleton.</li><li>Add external variables for the tracked transforms or mapped target transforms, plus a tracking-valid flag.</li><li>In the gameplay actor/component, read the hand sample once on the game thread and prepare the transforms in the space the rig expects.</li><li>Feed the frame through the Animation Blueprint/Control Rig integration. Define the update order so the rig uses one coherent sample.</li><li>Set the wrist/root placement first.</li><li>For each finger, apply mapped rotations from parent toward child while preserving reference translations for the rotation-driven version.</li><li>Leave helper bones untouched initially.</li><li>When tracking is unavailable, hide/fade the mesh and stop accepting gestures. Do not make a default open pose appear tracked.</li><li>Add smoothing only after correctness is proven.</li></ol><p>The exact variable-binding nodes depend on the chosen rig and Animation Blueprint. This article intentionally does not invent a universal graph for an unspecified asset. Publish screenshots of your actual graph once the rig exists.</p><h3>6. Diagnose visual errors systematicallylink</h3><p><strong>All joints align but fingers twist: </strong>inspect bone axes and calibration offsets. The position provider is probably functioning.</p><p><strong>Wrist aligns but fingertips are consistently short:</strong> compare mesh lengths and tracked anatomy. Consider uniform hand scaling or IK after measuring the discrepancy.</p><p><strong>One hand works and the other is mirrored: </strong>inspect the left/right bone mapping. The visionOS runtime already performs its own OpenXR orientation conversion; do not repeat it.</p><p><strong>Mesh jumps when pawn moves: </strong>check whether world transforms were supplied to a component-space animation node or transformed twice.</p><p><strong>Mesh lags behind debug dots:</strong> visual smoothing, animation update order or tick timing adds delay. Draw both the raw and rendered fingertip positions to measure it.</p><h3>7. Rendering versus physical interactionlink</h3><p>A detailed skinned mesh does not need a full dynamic physics body for each phalanx. For direct touch, use small query spheres at selected fingertips. For grabbing, use gesture intent plus a candidate volume. For believable hand contact, a dedicated collision rig can be developed later.</p><p>If you enable collision on both the skin mesh and the query representation, your own hand may block traces or produce duplicate contact events. Explicitly ignore visualization components in hand interaction queries.</p><h3>8. Acceptance and blog evidencelink</h3><p>Record open palm, fist, pinch, finger spread, wrist rotation, crossed hands and tracking loss. Report wrist error and fingertip error in physical centimeters with the known world scale. Compare raw joint dots against the deformed mesh in the same capture.</p><p>A good asset appendix includes the mesh license, import scale, reference pose image, bone mapping table, calibration transforms and a screenshot of the animation graph. Without those, a retargeting tutorial cannot be reproduced from code alone.</p><p>Apple’s native example likewise relies on a model whose reference pose matches its tracking skeleton. Its example is useful conceptually, but importing that mesh does not remove Unreal’s coordinate/mapping work. <a href="https://developer.apple.com/documentation/visionos/animating-hand-models-in-visionos">Animating hand models in visionOS</a></p><h3>Compare the glove to the tracking dotslink</h3><p>If the whole glove points backwards, start with the wrist and knuckle frame. If the palm looks right but the fingers stay straight, inspect the bone names and segment mapping. For example, the first index bone uses the direction from IndexProximal to IndexIntermediate. Each hand needs its own suffix. The two checks help you isolate a hand-wide alignment problem from a finger-chain problem.</p><h3>The rotation code that bends the glovelink</h3><p>In UpdateFingers in VisualizeHand.cpp, run this loop after resetting the chain and computing its authored LocalAxes. Finger.Points lists four tracked joints for the three bones in Bones. Read the current bone transform each iteration so it includes the parent movement.</p><pre>for (int32 Index = 0; Index &lt; 3; ++Index)<br>{<br>    const FVector Start = State.HandKeyLocations[static_cast&lt;int32&gt;(Finger.Points[Index])];<br>    const FVector End = State.HandKeyLocations[static_cast&lt;int32&gt;(Finger.Points[Index + 1])];<br>    if (Start.ContainsNaN() || End.ContainsNaN() || LocalAxes[Index].IsNearlyZero())<br>    {<br>        break;<br>    }<br>    const FVector Direction = (End - Start).GetSafeNormal();<br>    if (Direction.IsNearlyZero())<br>    {<br>        break;<br>    }<br>const FName Name = Bones[Index];<br>    FTransform Bone = Hand.GetBoneTransformByName(Name, EBoneSpaces::WorldSpace);<br>    const FVector CurrentAxis = Bone.GetRotation().RotateVector(LocalAxes[Index]);<br>    Bone.SetRotation((FQuat::FindBetweenNormals(CurrentAxis, Direction) * Bone.GetRotation()).GetNormalized());<br>    Hand.SetBoneTransformByName(Name, Bone, EBoneSpaces::WorldSpace);<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bbb51dbacb66" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>