Activate Lever using XR Simple Interactor or XR Lever

<p>I&rsquo;ve previously used Levers to activate events using the XR Lever script. In this article, I want to demonstrate how I used an animator with the trigger to activate a lever using the&nbsp;<strong>XR Simple Interactor.</strong></p> <p>First, I&rsquo;ve created my&nbsp;<strong>animation&nbsp;</strong>for my lever to go up and down with the use of the&nbsp;<strong>Trigger parameter</strong>.</p> <p><img alt="" src="https://miro.medium.com/v2/resize:fit:586/1*UEKGLOtoz8NGqiuN7Yh-UA.png" style="height:475px; width:586px" /></p> <p>I used the&nbsp;<strong>condition&nbsp;</strong>for both of these transitions to be the&nbsp;<strong>trigger&nbsp;</strong>&ldquo;LeverOn.&rdquo;</p> <p>Then, on my Lever, I placed a&nbsp;<strong>sphere collider</strong>, a&nbsp;<strong>rigidbody&nbsp;</strong>with kinematic on, and a&nbsp;<strong>Simple Interactor</strong>. Within the &ldquo;<strong>Select</strong>&rdquo; field, I want to drag the actual object called Lever1 onto this field, and then I will be able to see the drop down menu for&nbsp;<strong>Animator&nbsp;</strong>&rarr;&nbsp;<strong>SetTrigger</strong>(string). Then simply type in the name of the&nbsp;<strong>Trigger parameter&nbsp;</strong>used above for the&nbsp;<strong>animation</strong>.</p> <p><a href="https://medium.com/@eveciana21/activate-lever-using-xr-simple-interactor-or-xr-lever-acf961f754d7"><strong>Website</strong></a></p>
Tags: XR Lever