Adding mc speed using Numeric Stepper component
In previous example, our hero has constant speed set to 2. Speed is defined inside doTween function, as 6th parameter for xT and yT tweens. Off course, this speed doesn’t have to be constant at all. We will use Numeric Stepper component just to show how to change speed parameter. Instance of Numeric Stepper is "step". We change mentioned parameter from "2" to "step.value".
download hero_v2 source file.

When making a game, we will not use Numeric Stepper, but we can change hero speed in this way in relation to health or game level or whatever.





