I would like to use a slider in the UI to change the transform of an object - either the rotation or location.
It appears that those values are not exposed in a way that I can select them when setting the “On Value Changed” - I select the object, but don’t know what to pick within.
Any idea? Or do I need to expose those properties with a script? If so, how do I do that?
Events like “On Value Changed” can only call functions, not set variables or properties directly. The easiest way would therefore be to just create a simple function, like so:
Yes, if you add that as a script called “TransformSetters.cs” for example, you can find “TransformSetters > SetPositionX” in the Inspector’s dropdown.
Some quick terminology though: A property in C# is a member variable that has a getter and setter defined, like this for instance: public string name {get; private set;}
Not a big deal, but things like that could lead to confusion.