Logic Gadgets: Laser Scope

 

Icon
Name of gadget Laser Scope
Section Sensors & Input
Number of Tweak pages 3
Author LadylexUK, QuietlyWrong
Last updated 11 June 2019 [EA v1.03]

Description

This fires an (invisible) laser out from an object and sends signals if it hits something. This is known as raycasting in other programs. It  provides information about the object it hits, such as distance, orientation and position. You can use this for weapon manufacture for example.

Example Tutorial (from Media Molecule)

  1. Stamp a cube.
  2. Tweak the cube glow meter to 50%
  3. Stamp a laser scope in your scene
  4. Tweak the laser scope and connect hit something to the glow slider on the cube.
  5. We now tell the scope to only react to the cube. In Tweak menu of cube on label & ownership page turn off all label except object.
  6. On the laser scope on the label page so the same. This will now only react to things with an object label.
  7. Hit start time.
  8. Grab the scope and wave it at the cube. It will glow when the scope hits it.

Tweak Menus

Tweak Menu Page 1: Important Properties & I/O

[screenshot from beta; v1.03 identical]

  1. Tweak Menu Page 1: Important Properties & I/O
  2. Range
    2a. Input
    2b. Output
  3. Falloff
    3a. Input
    3b. Output
  4. Point At Tags
    4a. Input
    4b. Output
  5. Look for Tag
  6. Hit Something
    6b. Detected Output
  7. Local Space
    7a Input
    7b Output
  8. Consider Players
    8a. Input
    8b. Output
  9. Power
  1. Menu page indicator
  2. Range
    This will determine the length of the laser, and therefore how far it will detect. The input can dynamically change this value, the output sends a signal of the current length of the laser
  3. Falloff
    In addition to the laser’s length, a further falloff range can be specified. If the laser strikes its target within the falloff range, the “Hit Something” output will be a fractional value
  4. Point At Tags
    Set this on if you want the laser scope to point at tag gadgets in your scene
  5. Look For Tag
    When pointing at a tag you will put the name of the tag here
  6. Hit Something
    This is the main output of the gadget. It gives a signal of 0 or 1 depending on whether the laser has hit the chosen target. Fractional values may be output if the laser scope has a “Falloff” specified and the hit lies within that falloff range. The output falls from 1 down to 0 as the target moves from the near to the far end of the falloff range so the actual value returned depends on the size of the falloff
  7. Local Space
    Toggle this to affect any outputs that return position or direction information; if off, any such outputs are relative to the global axes of the scene, whereas if on, they are relative to the gadget’s own axes and orientation.
  8. Consider Players
    Turn this on when using the laser scope in conjunction with other player-related logic in multiplayer games so that the relevant player number will be included in outputs.
  9. Power
    This is where you turn the gadget on/off
Tweak Menu Page 2: Labels
Laser scope 2
  1. Tweak Menu Page 2: Labels
  2. Detection Mode
  3. Match Mode
  4. Detect Labels
    4a. Label Inputs
  5. X-Ray Mode
    5a. Input
    5b. Output
  6. Power
  1. Menu page indicator
  2. Detection Mode
    • Objects that are visible
    • Objects that are hidden (invisible)
    • Objects that are visible or invisible
    • Objects that are Collidable
    • Objects that are Not Collidable
    • Objects that are either
  3. Detect Labels Match Mode
    • Any (find objects that match any of the below labels, can match any or all)
    • All (find objects that have all the below labels (must match all) (unlabelled is deselected)
  4. Detect Labels
    These labels can be set in each object, element or group or shape and can be used to determine actions that apply to only a certain sort of object. For example you may wish to only detect objects labelled as “machine” with the laser.

    • Friend
    • Foe
    • Scenery
    • Object
    • Machine
    • Weapon
    • Missile
    • Target
    • Unlabelled
  5. X-Ray Mode
    TBA
  6. Power
    This is where you turn the gadget on/off
Tweak Menu Page 3: Hit Detail Outputs

[screenshot from beta; v1.03 identical]

  1. Tweak Menu page 3: Hit Detail Outputs
  2. Hit Position
    2b. Output
  3. Hit Surface Orientation
    3b. Output
  4. Hit Distance
    4b. Output
  5. Power
  1. Menu page indicator
  2. Hit Position
    This returns the exact position at which the laser scope hits its target, if it does hit
  3. Hit Surface Orientation
    This gives the angle of the surface where the laser scope hits, so you can tell if it’s a full-on impact or a glancing blow, or set up ricochets and reflections
  4. Hit Distance
    This gives a number in metres between the target being hit and the laser’s point of origin
  5. Power
    This is where you turn the gadget on/off

Lex Tips

Useful Tutorials

 

 

Version Updates

v1.03 – cosmetic changes to a tweak tab only

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.

Blog at WordPress.com.

Up ↑

%d bloggers like this: