informa
2 min read
Featured Blog

VR Tutorial Breakdown: Building a Bow and Arrow Grappling Hook

A summary of our livestream showing how to build a bow and arrow grappling hook for VR.

What do you get when you cross a bow and arrow with a grappling hook in VR? A super exciting way to move around a virtual environment! Huge shout out to Ben Lang for mentioning this idea on Twitter!

Implementation

In the past, we made a tutorial on how to implement your own bow and arrow with the HTC Vive. But to speed up implementation of this mechanic, we looked to the SteamVR Interaction System, which includes an open source, highly polished Bow and Arrow that happens to also have been used in The Lab.

Bow and Arrow from The Lab

Using this as base, we simply needed to tweak their implementations by adding some C# events that we could listen to in the Arrow.cs script.

3 lines of code added to Arrow.cs

Screenshot of Line Renderer

With these events called in the right place, we could then write our own script to listen and handle the behavior of our grappling hook. Specifically, when the arrow is released, we want to start drawing the line for our chain. And when the arrow lands, we want to teleport along the path the arrow took. To do this, we created a Line Renderer for each arrow that is released and every frame we add the position of the arrow to the Line Renderer, so that it can appropriately draw the chain

And 50 lines of code later, we are now able to teleport anywhere in our scene!

Hooking from Tree to Tree

Future Improvements

  1. If we hook a small object, bringing that object towards us instead of teleporting (as mentioned in Ben’s tweet)
  2. Using an FOV limiter like in Eagle Flight to mitigate motion sickness.
  3. Tweakable stopping distance to mitigate vergence-accommodation issues.

To Conclude

Of course, this movement scheme is not for the faint of heart. But if motion sickness is not a factor for you, then by all means have fun pretending you are the Green Arrow as you move around the forest! Something I also learned on Twitter is that an FOV limiter will not mitigate eye strain issues from quickly moving to big objects, which is a result of the vergence- accommodation conflict. So that is another thing to keep in mind if you easily get eye-strain in VR.

If you are interested in building this for yourself, check out the edited recording of our live stream below, where we will be walking you through step-by-step on how to build it yourself.

Happy building!

Latest Jobs

Treyarch

Playa Vista, California
6.20.22
Audio Engineer

Digital Extremes

London, Ontario, Canada
6.20.22
Communications Director

High Moon Studios

Carlsbad, California
6.20.22
Senior Producer

Build a Rocket Boy Games

Edinburgh, Scotland
6.20.22
Lead UI Programmer
More Jobs   

CONNECT WITH US

Register for a
Subscribe to
Follow us

Game Developer Account

Game Developer Newsletter

@gamedevdotcom

Register for a

Game Developer Account

Gain full access to resources (events, white paper, webinars, reports, etc)
Single sign-on to all Informa products

Register
Subscribe to

Game Developer Newsletter

Get daily Game Developer top stories every morning straight into your inbox

Subscribe
Follow us

@gamedevdotcom

Follow us @gamedevdotcom to stay up-to-date with the latest news & insider information about events & more