docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Forces reference guide

    Proxy forces allow you to express a web of flexible spring-like forces that pull your proxy into its final position. For more information about proxy forces you can jump to the forces section.

    Below are the key concepts, types, and main properties that the Proxy forces system uses.

    Forces (ProxyForces)

    ProxyForces

    Collects and applies the forces below onto this object. One per GameObject. If you enabled the Require Forces* option, set forces to act as starting conditions to filter out invalid starting states.

    Alignment (ProxyAlignmentForce)

    ProxyAlignmentForces

    Applies a force that aligns this object relative to another object. This supports multiple target relations. Depending on the purpose of your application, they work as follows:

    Target Relation Description
    Move To And Align With Moves and rotates to align with the target object.
    Move To And Face Moves to the target object and faces it (faces towards the Z axis).
    Center In Front Of And Face Moves in front of the object and faces it (faces towards the Z axis), regardless of distance.
    Scene Initial Relative Pose Saves the initial alignment (in the scene) from the target to this object, and applies a force to regain that alignment.
    Scene Initial Relative Angle Saves the initial angle (in the scene) from the target to this object, and applies a force to regain that angle.

    Scale forces control the amount of force applied towards the goal pose. Set this value to 0 to make the force have no effect and 1 to apply the full force.

    Region - Occupancy (ProxyRegionForceOccupancy)

    Describes how the object occupies space and applies a force to keep it from colliding with other occupied spaces. By default, Unity MARS assigns a unit cube to the region transform and creates this cube as a child of the Proxy. This transform defines the region's shape and pose.

    ProxyRegionForceOccupancy

    Note: Because Proxy forces don't depend on Unity's physics system, if you want to change the region transform of any Proxy force, you only have to change the scale of the transform assigned in the Region Transform object field.

    Padding regions are used to model empty/negative space around the object. They can overlap with other paddings but will collide with occupied regions. If you enable the Is Padding option, the Proxy will avoid occupied regions, but will allow overlap with other padded areas.

    Region - Towards (ProxyRegionForceTowards)

    ProxyRegionForceTowards

    Describes a region that is attracted towards other objects (an attach-shape or snap-point). A "towards" region is often used to describe parts of objects that should be in contact with a surface such as a wall, the floor, or both.

    You can configure this force using the following parameters:

    Parameter Description
    Towards Layers Filters the attraction to only the selected layers.
    Towards Alignment Filters the attraction to the set alignment (vertical, horizontal up, etc.)
    Towards Edge Only Attraction can be only towards the edge of the object. This is useful when defining corner alignments, for example.
    Region Transform Describes the shape of the attachment or attraction region relative to the proxy.

    Region - Plane2D (ProxyRegionForcePlane2D)

    ProxyRegionForcePlane2D

    Describes a flat 2D region at the object origin that is attracted towards other planes and provides a way to automatically pull the size and alignment of this region from other Conditions on the Proxy.

    You can configure this force using the following parameters:

    Parameter Description
    Keep Match Plane When enabled within a plane proxy, only is attracted to the matched plane.
    Use Plane Size Condition When enabled, gets the region size from a plane size condition available at start.
    Use Alignment Condition When enabled, gets the region's alignment from an alignment condition available at start.
    Plane Size Size of the 2D plane in X and Y/Z axes (can automatically pull from an associated plane size condition).
    Plane Alignment Defines which planes to align with, like only horizontal up (can automatically pull from an associated alignment condition).

    Did you find this page useful? Please give it a rating:

    Thanks for rating this page!

    Report a problem on this page

    What kind of problem would you like to report?

    • This page needs code samples
    • Code samples do not work
    • Information is missing
    • Information is incorrect
    • Information is unclear or confusing
    • There is a spelling/grammar error on this page
    • Something else

    Thanks for letting us know! This page has been marked for review based on your feedback.

    If you have time, you can provide more information to help us fix the problem faster.

    Provide more information

    You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:

    You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:

    You've told us there is information missing from this page. Please tell us more about what's missing:

    You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:

    You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:

    You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:

    You've told us this page has a problem. Please tell us more about what's wrong:

    Thank you for helping to make the Unity documentation better!

    Your feedback has been submitted as a ticket for our documentation team to review.

    We are not able to reply to every ticket submitted.

    In This Article
    • Forces (ProxyForces)
    • Alignment (ProxyAlignmentForce)
    • Region - Occupancy (ProxyRegionForceOccupancy)
    • Region - Towards (ProxyRegionForceTowards)
    • Region - Plane2D (ProxyRegionForcePlane2D)
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)