I want Print yvelocity that show what is the Player yvelocity number.
I add this script to MyActor=>Draw Actor=>Script Editor:
- Code: Select all
sprintf(texts.text, "%d", Player.yvelocity);
but always show 0 value. can anyone help me?
Thanks
sprintf(texts.text, "%d", Player.yvelocity);
MyActor.textNumber=player.yvelocity
you can create a text actor and use this code:
MyActor -> Draw Actor -> Script editor ->
CODE: SELECT ALL
MyActor.textNumber=player.yvelocity
It's true that Goettsch's solution will work in this case, but I thought I should let you know why your code wasn't working too: In your sprintf you use the placeholder "%d" which is meant for integers, but yvelocity is a double. You have to use "%f" for floats and doubles.
Users browsing this forum: Google [Bot] and 1 guest