Logic Gadgets: Head/Camera Tracker

Icon logic gadgets - vr head-camera tracker
Name of gadget Head/Camera Tracker
Section Gameplay Gear
Number of Tweak pages 4
Author LadylexUK, QuietlyWrong
Last updated 29 July 2020 [v2.16]

Description

The Head/Camera Tracker is a gadget that helps you to give the player a heads-up display whereever they go in your scene. Although it was introduced with the VR update, it works outside VR and provides a new way to group elements around the player’s viewpoint. When in VR it also tracks the PSVR headset in real space, so you can use it to find out the exact point in virtual space that the player is looking from, and in what direction, able to move around even if the game camera itself is stationary.

Rather than having to arrange items around every camera, you only need to place them in the tracker’s group and they will automatically appear around the player’s viewpoint no matter whether the display is centred on a camera gadget, a possessed puppet or the free imp.

VR head tracker gizmoUnlike most gadgets, it is a special group that can be scoped into to place any elements that you want to follow and react to the player’s view position. As such, it can’t be placed on a microchip. Instead it appears (within edit mode) as a translucent gizmo on screen, as shown here. Note that individual elements in the group must not be set to Moveable (physical settings) or they will not follow the gadget.

It doesn’t matter where you put the gadget in your scene or how you orient it – it automatically jumps to the player’s current viewpoint and anything in the group will go with it.. The arrow on the gizmo lines up with the viewing direction.

When you scope into the Head/Camera Tracker, there is a “Look Through Head” button in the context menu (menu down the right hand side of the screen). Selecting this allows you to immediately jump to the tracker’s current position and orientation, so you can see what the player would see in that position.

Example Tutorial (adapted from Media Molecule)

  1. Let’s make a health bar. Start with a basic scene.
  2. Grab a Head/Camera Tracker from the gadgets menu and stamp it somewhere in your scene.
  3. Go into Paint Mode and select Rule Flecks
  4. Draw a straight stroke in a colour that stands out well from the background.
  5. Exit back to assembly mode.
  6. Grab the stroke (R2), hover over the Head/Camera Tracker gizmo and (still holding the stroke) press L1 and X to scope into the group.
  7. Drop the stroke somewhere in front of the head. This will be the health bar at full extent.
  8. Press the Look Through Head button on the context menu to view the stroke exactly how it would appear to the player – adjust it so it looks like a health bar.
  9. Open the stroke’s tweak menu and find the End Point tweak on the Stroke Properties page.
  10. Tweak the End Point to 1% – you’ll see the stroke reduce to one hundredth of its length.
  11. Leaving the stroke’s tweak menu open, scope all the way out of the group.
  12. Grab a blank puppet from the gadgets menu and stamp one in your scene.
  13. Scope into the puppet and open the Puppet Logic microchip.
  14. Within the puppet logic microchip, identify and open the Controller Logic chip.
  15. Open the Health Manager’s tweak menu.
  16. Connect the Current Health output from the Health Manager to the End Point input of the stroke’s tweak menu.
  17. The wire blend on the End Point input needs to be set to “modulate”. If it is not, hover over the input and press L1 and X to cycle through the options to change it to modulate. This should cause the End Point to jump to 100% (it multiplies the 1% by the health value).
  18. Close all the tweak menus and microchips and scope all the way out of the puppet.
  19. To test our creation, we need a way to change the puppet’s health. Grab a Health Modifier gadget and stamp that somewhere in your scene.
  20. Open the Health Modifier’s tweak menu.
  21. Set the Health Modifier’s Modification Amount to -20.
  22. Set the Modifier Mode to “Continuous”.
  23. Set the Modifier Type to “Zone”.
  24. Set up the zone however you like, bearing in mind that to test it you’ll need to be able to run in and out of it easily.
  25. The Health Modifier’s zone will not be visible in Play Mode so you may find it useful to mark its location in some way – place small sculpts around it or paint the floor it stands over, for example.
  26. Now switch to Play Mode, possess the puppet and run in and out of the zone – all being well, you should see your new health bar decrease as the puppet takes damage!

Tweak Menus

Click on arrows to reveal

Tweak Menu 1: General
VR head tracker tweaks1
  1. Tweak Menu page 1: General
  2. Visible
    2a. Boolean input (on/off)
    2b. Boolean output (on/off)
  3. Moveable When Not Following
    3a. Boolean input (on/off)
    3b. Boolean output (on/off)
  4. Follow Head in VR
    4a. Boolean input (on/off)
    4b. Boolean output (on/off)
  5. Multiply Scale
    5a. Numeric input
    5b. Numeric output
  6. Follow Player’s Head
    6a. Player data input
    6b. Player data output
  7. Power
  1. Menu page indicator
  2. Visible
    As with any element group, it has a visibility setting that allows you to choose between the whole group being visible (on) or invisible (off).
  3. Moveable When Not Following
    As with any element group, the Head Camera Tracker has a “Moveable” setting, though in this special case, it only applies to the group when the group is not currently following the player’s controller movements. While moveable, a group will react to physical forces such as collisions and gravity (if applicable).
  4. Follow Head in VR
    If this is activated, the group will move and rotate with the player’s PSVR headset, so the player’s view of the group itself never changes, no matter how they turn and move. This is effectively how the group behaves when not in VR. So if – within the group – you had an object in front of the tracker and an object behind, the player would only ever see the object in front.
    By default, however, this setting is off, in which case – in VR – the group remains in position in virtual space when the player turns or moves their PSVR-adorned head, such that the player can now turn their head to see an object in the ‘behind’ part of the group.
  5. Multiply Scale
    This setting allows you to select or dynamically alter the scale of the group with respect to the tracker. As you decrease it, any visible elements in the group will seem to shrink and get closer to the player’s eyes; increase it to make the group bigger, elements moving further away from the centre. The elements take up the same amount of “screen space” (bigger-further / smaller-closer) so the effect is only noticeable in stereo vision.
  6. Follow Player’s Head
    By default, the tracker follows player 1’s head. Use this setting if you want to disable the tracker or specify which player the tracker will follow (1 to 4).
  7. Power
    Available on all pages of the menu. You can wire into this to turn the gadget on or off.
Tweak Menu 2: Look Cursor Settings
VR head tracker tweaks2
  1. Tweak Menu Page 2: Look Cursor Settings
  2. Enable Look Cursor
    2a. Boolean input (on/off)
    2b. Boolean output (on/off)
  3. Show Look Cursor
    3a. Boolean input (on/off)
    3b. Boolean output (on/off)
  4. Cursor Range
    4a. Numeric input
    4b. Numeric output
  5. Falloff
    5a. Numeric input
    5b. Numeric output
  6. Consider Players
    6a. Boolean input (on/off)
    6b. Boolean output (on/off)
  7. Hit?
    7b. Player data output
  8. Hit Position
    8b. 3-dimensional position output
  9. Hit Surface Orientation
    9b. 3-dimension orientation output
  10. Hit Distance
    10b. Numeric output
  11. Power
  1. Menu page indicator
  2. Enable Look Cursor
    Switch this on to enable the Look Cursor. This is a special type of Laser Scope specific to the Head/Camera Tracker. Unlike a Laser Scope gadget, there is no visible beam. Because it is tied to the tracker, it will only work when the tracker is currently following a player, and it always points directly out into the centre of the player’s viewpoint.
    Turning it on adds a laser-beam gizmo to the Head/Camera Tracker to indicate the direction and range; the range and fall-off can then be tweaked directly on the gadget gizmo.
  3. Show Look Cursor
    If this is enabled, a small spot appears in the centre of the player’s viewpoint, to help them to line up their gaze on an interactive object. If you need the player to engage with objects via the Look Cursor, it’s a good idea to make this reticule visible to avoid any potential frustration, particularly so if the objects in question are small on screen.
  4. Cursor Range
    Use this to specify how far (in metres, from 0 to 10,000) that the Look Cursor extends to. Beyond this range, it will not return any “Hit” information (tweaks [7-10]) nor will it trigger Look Cursor Sensors.
  5. Falloff
    As with Laser Scopes, you can specify a falloff range over which the Look Cursor still outputs a fractional “hit” signal, the value depending on how close the target is to the player (closer = stronger signal).
  6. Consider Players
    This is a toggle to decide whether the gadget will include player-specific information with the following “hit” outputs. If you’re making a multiplayer game such that you need to know which player is facing at a target item, you’ll need to activate this.
  7. Hit?
    This outputs a signal if the Look Cursor’s beam intersects any applicable object (depends on the “Detect Labels” options as set in Tweak Menu 3).
  8. Hit Position
    This outputs a three-dimensional signal giving the X, Y and Z co-ordinates of the point at which the look cursor’s beam intersects the object it is hitting.
  9. Hit Surface Orientation
    This outputs a three-dimensional signal giving the rotational orientation of the surface that the look cursor’s beam is hitting.
  10. Hit Distance
    This outputs the distance from Head/Camera tracker to the point that the Look Cursor is hitting.
  11. Power
    Available on all pages of the menu. You can wire into this to turn the gadget on or off.
Tweak Menu 3: Labels
VR head tracker tweaks3
  1. Tweak Menu page 3: Labels
  2. Detect Visible
  3. Detect Collidable
  4. Match Mode
  5. Detect Labels
    5a. Boolean inputs (on/off)
  6. X-Ray Mode
    6a. Boolean input (on/off)
    6b. Boolean output (on/off)
  7. Power
  1. Menu page indicator
  2. Detect Visible
    Here you can determine whether the Look Cursor reacts to the visibility of objects:

    • Detect objects that are visible only
    • Detect objects that are invisible only
    • Detect objects that are visible or invisible
  3.  Detect Collidable
    Here you can determine whether the Look Cursor reacts to the collision settings of objects:

    • Detect objects that are collidable only
    • Detect objects that are not collidable only
    • Detect objects regardless of whether they are collidable
  4. Match Mode
    Select between:

    • Any – detect objects that match any of the below labels, can match any or all
    • All  – only detect objects that have all the below labels (“Unlabelled” is disabled)
  5. Detect Labels
    Set one or more of these to dictate the types of element (any object that has its own label settings) that the Look Cursor will detect.

    • Friend
    • Foe
    • Scenery
    • Object
    • Machine
    • Weapon
    • Missile
    • Target
    • Unlabelled
  6. X-Ray Mode
    By default, with X-Ray Mode disabled, the Look Cursor will be blocked as soon as it hits any object, even if its labels are such that it does not “detect” that object. If you enable X-Ray Mode, the Look Cursor will continue through any objects that it doesn’t detect and can detect any appropriately-labelled objects on the other side.
  7. Power
    Available on all pages of the menu. You can wire into this to turn this gadget on or off.
Tweak Menu 4: Outputs
VR head tracker tweaks4
  1. Tweak Menu page 4: Outputs
  2. Head Position
    2b. Transform output
  3. X Direction
    3b. 3-dimensional output
  4. Y Direction
    4b. 3-dimensional output
  5. Z Direction
    5b. 3-dimensional output
  6. Is In VR
    6b. Boolean output (on/off)
  7. Is VR Comfort Mode On
    7b. Boolean output (on/off)
  8. Power
  1. Menu page indicator
  2. Head Position
    This outputs a fat wire containing full “transform” data, including the tracker’s position, orientation and scale. When not in VR, this should be equivalent to the current camera’s position but in VR, it also takes into account the movement of the player’s head as the PSVR headset itself is tracked in space.
  3. X Direction
    This outputs a 3-way signal indicating the orientation of the tracker’s X axis (the axis that runs side-to-side, from player’s left ear to right ear).
  4. Y Direction
    This outputs a 3-way signal indicating the orientation of the tracker’s Y axis (the axis that runs up-and-down from the top of the head to the jaw).
  5. Z Direction
    This outputs a 3-way signal indicating the orientation of the tracker’s Z axis (the axis that runs front-to-back, between the eyes and the back of the head).
  6. Is In VR
    This output tells you whether or not the player is currently viewing the scene with a PSVR headset. In this way you might change aspects of the user interface to better suit a TV screen or the headset view accordingly.
  7. Is VR Comfort Mode On
    This output tells you whether the player has VR Comfort Mode turned on in preferences. Comfort Mode makes some changes to the way movement is handled, so there may be occasions when it is useful to have different camera behaviours depending on this setting.
  8. Power
    Available on all pages of the menu. You can wire into this to turn the gadget on or off.

Lex Tips

Useful Tutorials

 

Comments and Feedback

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Create a free website or blog at WordPress.com.

Up ↑

%d bloggers like this: