Number display - hold last number
I want to use number displays for debug info - showing eg impact amount or velocity. But as soon as the impact goes away the number changes back to zero so it disappears immediately. How do I get the number to stay visible until the next impact?
-
One way is to set a variable then wire its value into the text displayer.
Another would be to wire into the set value of a value slider. -
It occured to me that the value you're getting when the impact happens might revert to 0 afterwards, resetting the value in either of these methods. So you would want a check such that if it was zero you just set the value to its existing value instead. You can wire the output of the slider back into the input but through a node which is powered based on the output of a calculator doing the equality check. You'd have to handle both cases in this way.
-
Perhaps a zero is a valid value for you so you could instead take an output from the impact sensor and only set the new value if that is true.
So you have the old value and the new value each going into a node. One node is powered by the impact true or whatever, the other by that through a NOT. Then add both of those node's outputs together. Since the unpowered node will output 0, you should get the correct output to then set your variable etc. -
What David has suggested would defs work with some debugging - have you tried the signal manipulator too? It has some really cool properties about retaining signals that might be useful in this case as well :)
-
Will have a look. Was trying to understand how big an impact is to help understand when to use to blow up the player. But at the moment i’m trying velocity instead.
請登入寫評論。