Please Help Me Trigger A Camera Sequence By Looking at a specific image (VR).

Hi guys,

First up, please forgive me if I’m not using the correct terminology to explain myself, I’m really new to UE4, and am currently learning as I go!

I’m working on a simple (no controller required) on rails VR experience where the viewer is flown through an environment from the POV of a ‘TravelCam’ (if this is the right phrase?).

But before this experience starts, I have the ‘PlayerStart’ set inside a black box (to simulate a void) under the map with some introductory text, and would like for the player to be able to trigger the start of the on rails experience by simple looking at (with the VR headset) a image for a second or two - Just like the Rift’s start up health and safety warning where it asks you to “Hover Over This box For Two Seconds To Acknowledge” the warning and progress.

I’m only just getting my head around the building and texturing these worlds - I really don’t know where to begin with this, so any help would be GREATLY appreciated!

Many thanks,

Detta

  1. Create a blueprint interface “ActivateInterface” with a function/event “Activate”.
  2. Add this interface to the blueprint actor you want to use as a trigger. In the Activate function, place the logic for starting the experience.
  3. In your pawn/character, make a “GazedActor” actor reference variable and a “GazeDuration” float.
  4. On tick make a trace forward from the camera (google it). If you hit an actor, compare it to GazedActor and if equal add tick time to GazeDuration.
  5. If the hit actor is not the one stored, store the hit actor in GazedActor and set GazeDuration to zero.
  6. Check if GazeDuration is greater than the time you want for triggering, if so call ActivateInterface->Activate on the hit actor. (It will fail silently if the actor do not implement ActivateInterface.)

HavockX, thank you so much for taking the time to reply. Currently, most of what you said is currently like sanskrit to me, but it, gives me a very solid place to start - I genuinely appreciate it. :slight_smile:

I’m going to make an empty project with the sole purpose of trying to make this work, wish me luck!

Good luck!

Hey Havock, after 2 days of casual tinkering, I’m having zero luck getting anything to play. I can’t even find the “ActivateInterface” function - It’s clear I still have a lot to learn.

If you have a moment, here is my test project (only 7mb):

https://drive.google.com/file/d/0B65ixgoMHNyddTc1bVlSalR4SEk/view?usp=sharing

Absolutely no pressure, but if you find yourself at a loose end, perhaps you could provide an example on that and send it back my way?

It has a camera following a simple matinee sequence, a starting location below said camera, and a static mesh actor to use as a gaze trigger.

The blueprint you need to create 1st is an interface.

Then name it ActivateInterface. Open the blueprint and rename the untitled function to Activate.



This should help you with adding the interface into your Blueprint actor.

Thanks both, but I’ve been at it for 7 hours straight now, and I just can’t crack it. :frowning:

I got the ray casting thing working with this:

This is printing to screen anything that I am looking at, including the ‘Blueprint_Trigger’ I made:

f1e698d54fbf90fd6a45cf99f4f41e8e35f6a509.jpeg

But beyond that, I must have tried 100+ combinations of things using the ‘Activate Interface’ suggestion to get the Matinee to play and PoV to shift to the other camera without success.

I’m starting to get quite disheartened by my apparent inability to understand why things aren’t working.