Skip to content

DOCS: How to use processors #2171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 52 commits into
base: develop
Choose a base branch
from
Open

DOCS: How to use processors #2171

wants to merge 52 commits into from

Conversation

ritamerkl
Copy link
Collaborator

@ritamerkl ritamerkl commented Apr 23, 2025

Description

This adds more documentation on how to use processors.

Testing status & QA

No testing

Overall Product Risks

  • Complexity: low
  • Halo Effect: low

Comments to reviewers

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

After merge:

  • Create forward/backward port if needed. If you are blocked from creating a forward port now please add a task to ISX-1444.

@ritamerkl ritamerkl marked this pull request as draft April 23, 2025 15:05
@ritamerkl ritamerkl marked this pull request as ready for review April 29, 2025 13:32
@ritamerkl ritamerkl requested a review from jfreire-unity April 29, 2025 13:32
@LeoUnity LeoUnity requested a review from JonMUnity May 1, 2025 12:26
Copy link
Collaborator

@lilisha-unity lilisha-unity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did my first pass on the PR. Please fix the note formatting and replace the placeholder image alt text with something more descriptive. Also, there are quite a few sentences written in passive voice—please rewrite them in active voice where appropriate. You can refer to the Unity style guide for reference: https://docs-style-guide.unity.com/style/use-active-voice.

@codecov-github-com
Copy link

codecov-github-com bot commented May 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

@@             Coverage Diff             @@
##           develop    #2171      +/-   ##
===========================================
- Coverage    67.81%   67.78%   -0.03%     
===========================================
  Files          367      367              
  Lines        53513    53513              
===========================================
- Hits         36288    36276      -12     
- Misses       17225    17237      +12     
Flag Coverage Δ
mac_2021.3_pkg 5.41% <ø> (ø)
mac_2021.3_project 70.42% <ø> (ø)
mac_2022.3_pkg 5.19% <ø> (ø)
mac_2022.3_project 65.29% <ø> (ø)
mac_6000.0_pkg 5.20% <ø> (ø)
mac_6000.0_project 67.72% <ø> (+<0.01%) ⬆️
mac_6000.1_pkg 5.20% <ø> (ø)
mac_6000.1_project 67.71% <ø> (-0.02%) ⬇️
mac_6000.2_pkg 5.20% <ø> (ø)
mac_6000.2_project 67.71% <ø> (ø)
mac_trunk_pkg 5.20% <ø> (ø)
mac_trunk_project 67.71% <ø> (ø)
win_2021.3_pkg 5.42% <ø> (ø)
win_2021.3_project 70.49% <ø> (ø)
win_2022.3_pkg 5.20% <ø> (ø)
win_2022.3_project 65.37% <ø> (+<0.01%) ⬆️
win_6000.0_pkg 5.20% <ø> (ø)
win_6000.0_project 67.78% <ø> (+0.09%) ⬆️
win_6000.1_pkg 5.20% <ø> (ø)
win_6000.1_project 67.78% <ø> (ø)
win_6000.2_pkg 5.20% <ø> (ø)
win_6000.2_project 67.78% <ø> (+<0.01%) ⬆️
win_trunk_pkg 5.20% <ø> (ø)
win_trunk_project 67.78% <ø> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@lilisha-unity lilisha-unity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finished my review with some suggestions.

Copy link
Collaborator

@ekcoh ekcoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, added some minor comments


#### Example: Racing game speend control

In a case where the player is not supposed to fall below a certain base speed, but also cannot exceed a certain maximum speed, the Clamp Processor is the one you may want to use.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, IMO this to be game-logic and not input logic, but its fine as-is to show as example.

@ekcoh
Copy link
Collaborator

ekcoh commented Jun 11, 2025

Looks like there is some CI issues that needs attention

@ritamerkl ritamerkl requested review from jfreire-unity and removed request for JonMUnity June 12, 2025 11:55
Copy link
Collaborator

@jfreire-unity jfreire-unity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, an important improvement for our docs!
I added some minor suggestions.
Mostly nitpicks around using "Processors" and "processors". I probably didn't catch them all, but it would be good to always use the same.

"invert,normalize(min=0,max=10)"
```

## Choose the right Processor
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great section 👏

The [Scale Processor](ProcessorTypes.md#scale) multiplies the input value by a given factor X. This applies to float values as well as vectors, where each axis is multiplied by the corresponding factor specified for that axis.
This allows you to assign weight to input values, which can, for example, make a particular type of control easier to use.

#### Example: Horizontally aligned Camera
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it makes sense to add now but I feel it can be mentioned. This example would be a great shout out to another package users might not be aware of, such as Cinemachine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants