Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Component:SnapTarget

The SnapTarget component allows a slot with a Snapper Component to attach to this slot.
Component image 
SnapTarget component as seen in the Scene Inspector

The SnapTarget component allows a slot with a Snapper Component to attach to this slot.

Fields

Fields
Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated.
Enabled Bool Controls whether or not this component is enabled. Some components stop their functionality when this field is disabled, but some don't.
SnapperWhitelist list of Snapper List of Snappers that are allowed to attach to this component
SnapperKeywordWhitelist direct SyncFieldList`1<String> List of keywords to match against a corresponding Snapper
Filters list of SnapperFilter A list of sync delegates that define what will snap to this snap target. These usually come from components that have this kind of sync delegate hidden, and requires a mod to reveal.
DirectSnapOnly Bool Unused
MaximumSnapDistance Float The maximum distance the Snapper can snap with the Target. This value drives the SphereCollider radius
MaximumAngleDeviation Float The maximum angle the snapper can be compared to the angle of this snap target in degrees. Takes the shortest angle path as defined as the shortest path on a sphere.
AnimationTime Float The time it takes for the Snapper to lerp to the Target
AutoSnap Bool Whether a Snapper will snap instantly whenever it's origin is within the sphere, forcing the user holding it to let go. Rather than check the snap upon letting go and snapping in.
_snapColliderRadius field drive of Float The radius drive reference of the SphereCollider
proxySphere SphereCollider This must refer to a SphereCollider on the same slot as the SnapTarget. Usually refers to the one generated automatically when the SnapTarget was added.

Behavior

Allows the slot containing this component to receive slots that contain a Snapper component, the Snapper slot will enter the hierarchy of the SnapTarget slot and get positioned to the center.

Control over linking

There are a number of ways to control what is allowed to link with the SnapTarget.

  • SnapperWhitelist
    • A list of reference specific snappers that is allowed to link.
  • SnapperKeywordWhitelist
    • A list of Strings that need to match to allow the link.
  • Filters

Detecting Snappers

Unlike grabbers, Snappers do not have a way to detect events directly. (GH#2059)

A common approach to drive something else to use ProtoFlux:ChildrenCount on the slot that contains a SnapTarget and monitor if it changes using ProtoFlux:Equals.

For impulses ProtoFlux:SlotChildrenEvents can be used to detect snappers being attached or removed.

Examples

See: Component:Snapper#Examples

See Also

Component:Snapper

This article or section is a stub. You can help the Resonite wiki by expanding it.