Vrtk: Introduce a no-op highlighter and use that by default

Created on 7 Oct 2017  路  8Comments  路  Source: ExtendRealityLtd/VRTK

Environment

  • Source of VRTK: github release/3.3.0-alpha
  • Version of VRTK: 5021a12a4
  • Version of Unity3D: 5.6.3p4
  • Hardware used: Vive
  • SDK used: SteamVR

Current behavior

We have an object whose material is changed during runtime. We don't use highlighters at all, but since VRTK adds one by default, it causes the material on this specific object to misbehave (see link below). As a workaround we have to add a highlighter and set it as not active.

Video of the glitch

Expected behavior

An interactable object without a highlighter shouldn't glitch like that.

Arguably it's a bug with highlighter since I don't remember that happening the first time I added VRTK to the project, but nevertheless I'd find it cleaner if VRTK didn't add highlighter if it wasn't told to.

bug

All 8 comments

VRTK only adds a default highlighter if you specify a highlight colour

https://github.com/thestonefox/VRTK/blob/master/Assets/VRTK/Scripts/Interactions/VRTK_InteractableObject.cs#L938-L948

Just specify the colour as Color.clear or #00000000 and you won't get a highlighter.

That's not the default behavior anymore as documented here and implemented here.

If you're on 3.3.0-alpha then you need to add a VRTK_InteractObjectHighlighter to get highlighting anyway.

If you're automatically getting one of those it means the deprecated Touch Highlight Color paramter on your intereactable object is still set to something that isn't Color.clear

Uncomment the [HideInInspector] bit in the Interactable Object script and check to see if you have a colour set.

[Tooltip("The Color to highlight the object when it is touched.")]
[HideInInspector]
public Color touchHighlightColor = Color.clear;

The documentation does not say a highlighter will be created all the time, the highlighter is listed as an optional component, not a required component.

I'm adding the component from code, but I've double-checked - it's clear.

Add an interactable object to any game object, run the scene you don't get a highlighter by default

It's because it's removed in OnDisable, and it has disableWhenIdle = true by default. If you reach with the controller the Material Highlighter component appears.

Yeah i see it now, that's why it's always good to follow the issue template and create steps to reproduce.

Was this page helpful?
0 / 5 - 0 ratings