edited July 2022 in Makinom Support
Hey Friends -

I know @gamingislove is Out of Office - but @Scyra or @RustedGames - or anyone:

I have a script component on a game object - I just need to change the value of a float of that component (which in the component is actually a slider) - no clue why i am struggling with this, appreciate any help!

*edit -- looking for schematic advice on how to do that btw
Post edited by theProject on
  • Use the "Change Fields" node. You just need to give it the component, field(s), and object source.
  • Annnnnd @Acissathar with the assist! I’m hardcore blanking this weekend. I’ve don’t that a hundred times with Cinemachine and you would think I’d be there.

    Going to have to make a nice node workflow memory chart hahaha.

  • So while I achieved the result - what if I wanted that float to Lerp - like increase over time. I have it working, but its jarring as it changes the float instantly. Can we do this with a node the way I am or do I need to write a script for it?
  • Well, there is a Float Lerp node, but I've never tried it.
  • Thanks @Scyra - I think it’s going to get funny the way I’m doing to.

    Basically my spells in this game change the lands weather, and time - right now I have tickets for those in the inspector as floats (sliders) to manually adjust to find points I like. Now I have those points for the abilities - but it’s really jarring to instantly change the value lol
  • @theProject You could create the smoothing in code in a new method (coroutine for example) and rather than just setting the field through schematic, instead call the method that fires off the corountine using a Call Function node.

    Something like a new method of "SetNewValueWithLerp" in that script passing in the desired value, and then that just fires off a coroutine that lerps from the current value to the next rather than just instantly setting the new value.
  • @Acissathar @Scyra we are all on the same page, sometimes I swear I overcomplicate stuff and spends hours chasing something so simple. I did this same Lerp over time via script to get my Dissolve shader going.

    For those poor souls seeking an answer in the future, @Acissathar and @Scyra were pointing the right way, I’ll will be adding this to my Node Showcase on Tips and Tricks, as I believe we need more posts like that around case use node examples.

    For this, I wrote a coroutine within the script that controls my sky and weather.
    IEnumerator. In Makinom, the schematic simply used a Search Objects Node - check if variable exists node - using selected Data, and then Call Function node, which calls a regular void that fires my coroutine.

    Again more to come for the future teams that need help on the tips and tricks post.

  • theProject said: ...we are all on the same page, sometimes I swear I overcomplicate stuff and spends hours chasing something so simple.
    It's not just you. I spent an embarrassing amount of time trying to put a space between ability/item icons that were listed in an array, or sprite swapping instanced icons. It's nice that you're willing to share tips and tricks. I thought about it, but Dumb UI Hacks - How to Use Invisible Buttons as Spacers doesn't sound that great after all.
  • @Scyra - we are dev fam for sure lol - totally do it everrrryday hahaha! I'm just saying what we are all thinking at some point - im working on a node guide in my graph paper book, i swear its the one bit of ORK/MAK we all need lol
Sign In or Register to comment.