CustomFootholdComponent

A custom foothold Component. You can set to have a physical effect on an Entity on the foothold.

# Properties

[{"index":"SyncList> edgeLists (Sync)","0":"Indicates a foothold. A foothold consists of several connecting points."}]

[{"index":"float FootholdDrag (Sync)","0":"A friction force is applied to an Entity containing a RigidbodyComponent on the foothold. The larger the value, the faster it decelerates."}]

[{"index":"float FootholdForce (Sync)","0":"A force is applied to an Entity containing a RigidbodyComponent on the foothold. Move to the right if the value is positive, and to the left if negative."}]

[{"index":"float FootholdWalkSpeedFactor (Sync)","0":"The coefficient multiplied by the movement speed when an Entity with the RigidbodyComponent is on the foothold. The higher the value is, the faster the movement speed."}]

[{"index":"boolean IsBlockVerticalLine (Sync)","0":"Determines whether the Entity is blocked by vertical footholds in its TileMap. Only pertains to Entities with RigidbodyComponent."}]

[{"index":"boolean IsDynamicFoothold (ReadOnly)","0":"Can move the foothold or change the shape while playing if the value is true. Please be aware that changing the foothold's location or shape frequently may negatively affect your World's function."}]

[{"index":"boolean PhysicsInteractable (ReadOnly)","0":"If true, this may collide with a Dynamic rigid body (PhysicRigidbody) using the Physics feature."}]

[{"index":"RigidbodyMovementOptionType RigidbodyMovementOption (Sync)","0":"Sets options to apply to the RigidbodyComponent above the foothold."}]

##### inherited from Component:

[{"index":"boolean Enable (Sync)","0":"Checks whether Component is activated or not."}]

[{"index":"boolean EnableInHierarchy (ReadOnly) (HideFromInspector)","0":"Displays whether this Component is Enable in the hierarchy. If Entity Enable is false regardless of Component Enable, returns false."}]

[{"index":"Entity Entity (ReadOnly)","0":"The Entity that owns this component."}]

# Methods

##### inherited from Component:

[{"index":"boolean IsClient()","0":"Returns whether the current execution environment is a client or not."}]

[{"index":"boolean IsServer()","0":"Returns whether the current execution environment is a server or not."}]

# Examples

You can change the foothold's shape by modifying `edgeList`. When you change the foothold, please note the following:

  1. Changes will be applied only when `IsDynamicFoothold` is true.
  2. You must create a new list and overwrite it to apply the changes. Please refer to the example code below.



An example of changing part of the foothold.
    
    
    @Component
    script FootholdEdgeUpdater extends Component
        @ExecSpace("ServerOnly")
        method void OnBeginPlay()
            local target = _EntityService:GetEntityByPath(EntityPath)
            
            -- If you modify the element's value, the changes will not be applied to the foothold.
            -- target.CustomFootholdComponent.edgeLists[1][1] = Vector2(3, 0)
            
            -- You must create a new list and overwrite it.
            local list = {Vector2(3,0), Vector2(2,3)}
            target.CustomFootholdComponent.edgeLists[1] = list
        end
    end
    

An example of replacing the entire foothold.
    
    
    @Component
    script FootholdInitializer extends Component
        @ExecSpace("ServerOnly")
        method void OnBeginPlay()
            local listlist = {{Vector2(0,2), Vector2(3,2)},{Vector2(4,5), Vector2(3,8)}}
            local target = _EntityService:GetEntityByPath(EntityPath)
            target.CustomFootholdComponent.edgeLists = listlist
        end
    end
    

# SeeAlso

  * EntityService
  * [Making a Moving Foothold](/docs?postId=579)
  * [Making Footholds](/docs?postId=71)