Skip to content
This repository was archived by the owner on May 9, 2025. It is now read-only.
This repository was archived by the owner on May 9, 2025. It is now read-only.

Setting value for FloatVariable is causing GC allocations and slower execution #154

Open
@SharkWithLasers

Description

@SharkWithLasers

In one of my MonoBehaviours, I am updating a FloatVariable every Update.

However, I am noticing that this is causing the Update for the function to be much slower than if I had just set a float.

With the line
myFloatVariable.Value = myFloat, the Update function takes 0.54ms to complete and has a bunch of GC allocations:
image

Setting only the float itself is significantly less time:
image

Anyone know why this might be the case?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions