Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Resolved Ho to define a getter or setter

Discussion in 'Visual Scripting' started by NodeLondon, Jun 26, 2022.

  1. NodeLondon

    NodeLondon

    Joined:
    Jun 24, 2021
    Posts:
    10
    Hi there, I'm using DOTween & Unity Visual Scripting.

    I'm attempting to simply tween a float value. The node DoTween (To) requires a setter method input I believe. But how to define this via a script graph?

    Please see attached for clarity.

    Thanks in advance.
     

    Attached Files:

  2. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    1,790
    From a quick look at the docs, the setter is a delegate. UVS does not support delegate functionality.

    Use the DOFloat Dotween shortcut instead.
     
  3. NodeLondon

    NodeLondon

    Joined:
    Jun 24, 2021
    Posts:
    10
    Thank you PanthenEye :) I don't see this DoFloat node available to me, only for Materials - see attached. Might you know what Type Option or Node's I might need to add to see this?

    Thanks in advance.
     

    Attached Files:

  4. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    1,790
    My bad, I thought there's a shortcut for it. Turns out there isn't one for float and DoTween To is the only option, it seems. So either you write a custom C# node that will do Dotween To or you go for an alternate solution such as Mathf.Lerp.
     
  5. NodeLondon

    NodeLondon

    Joined:
    Jun 24, 2021
    Posts:
    10
    Thank you PanthenEye :) I'm glad it wasn't just me :)

    Rich