Unity Figma Importer
  • Getting Started
    • Figma Design Downloader
    • Figma Design
    • Unity Canvas Setup
  • Layout
    • Horizontal & Vertical Layouts
    • Grid Layout
  • Components
    • Text
    • Image
    • Button
    • Toggle
    • Slider
    • Scroll View
    • Input Field
    • Dropdown
    • Custom Component
  • Limitations
  • Bindings
  • Optimization
Powered by GitBook
On this page
  • Unity Importer Plugin
  • "State" variant
  • The hierarchy of Slider component variant
  • Binding keys of "Fill Rect" and "Handle Rect"

Was this helpful?

  1. Components

Slider

PreviousToggleNextScroll View

Last updated 1 year ago

Was this helpful?

In order for a Slider from Figma to be imported to Unity automatically, certain rules apply when designing a slider in Figma.

Unity Importer Plugin

In order for Figma Importer to understand which component it is trying to convert a figma node to a Unity UI element, Component Type from Unity Importer plugin must be selected as desired component type. "Slider" component type should be selected when designing a slider.

Direction of a slider can be selected through the plugin, there are 4 direction options: Left to right, right to left, top to bottom, bottom to top.

"State" variant

Sliders have 4 states: Default, Hover, Press, Disabled. These states must be designed as variants of a slider component set in Figma. The variant name in Figma must be "State" otherwise the importer won't be able to identify it.

The hierarchy of child nodes of a component set's variant must be the same for each and every one of them.

The hierarchy of Slider component variant

In order for importer to convert a slider component from Figma to Unity's built in Slider component, a predefined hiearchy should be applied to have expected behavior.

Keeping in mind the built in Unity slider hierarchy, design of a slider variant in Figma should look like:

Binding keys of "Fill Rect" and "Handle Rect"

Unity's slider component needs to have "Fill Rect" and "Handle Rect" set to behave as expected.

In order for importer to set these, binding keys should be set using Unity Importer plugin in Figma.

The binding keys for Handle Rect and Fill Rect must be "@Handle" and "@Fill" respectively.

Keep in mind that components & component sets are never imported to Unity, only instances of them are imported.

A slider component set in Figma
Unity built in Slider component hierarchy
Figma slider component set variant's hierarchy
Fill Rect and Handle Rect of a Slider component in Unity
"@Handle" binding key is set for Handle
"@Fill" binding key is set for Fill