- Joined
- Jul 10, 2009
- Messages
- 532
Hey guys,
I'm currently facing an issue with a texttag that vanishes after using
Precisely, the following code will create a working texttag with restricted lifetime, but removing the Wait will not:
Reason seems to be that
Note that even a zero-wait is too early. You need to wait at least ~0.025s to make it work (tested with timers).
Strangely enough, I couldn't reproduce the bug in GUI, so I might just have used some native wrong.
Is this a known thing? What am I doing wrong?
Best regards,
Eikonium
I'm currently facing an issue with a texttag that vanishes after using
SetTextTagPermanent(texttag, false)
immediately after creation.Precisely, the following code will create a working texttag with restricted lifetime, but removing the Wait will not:
Lua:
function CreateExampleFloatingText()
local texttag = CreateTextTag()
SetTextTagTextBJ(texttag, "test", 10)
SetTextTagPos(texttag, 0, 0, 0)
SetTextTagColor(texttag, 255, 207, 0, 0)
--So far so good. The texttag would be successfully created, if we stopped at this point.
--Now we add a small wait to make SetTextTagPermanent work. Removing the wait would make the texttag disappear.
TriggerSleepAction(0.025) --TriggerSleepAction used for example purposes for code simplicity. Would normally use timers.
SetTextTagPermanent(texttag, false) --Will make Texttag disappear, when the wait above is not present
SetTextTagLifespan(texttag, 2.00)
SetTextTagVelocityBJ(texttag, 64, 90)
end
Reason seems to be that
SetTextTagPermanent
makes the texttag disappear, when you call it too early after creation.Note that even a zero-wait is too early. You need to wait at least ~0.025s to make it work (tested with timers).
Strangely enough, I couldn't reproduce the bug in GUI, so I might just have used some native wrong.
Is this a known thing? What am I doing wrong?
Best regards,
Eikonium
Last edited: