• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Floating Text above an unit

Status
Not open for further replies.

hdm

hdm

Level 9
Joined
Nov 19, 2011
Messages
384
how can I make a floating text above an unit but following this unit forever? When I try to make it doesn't work cuz when the unit walks the floating text stays on its last position. How to make it walk along with the unit above it?
 

hdm

hdm

Level 9
Joined
Nov 19, 2011
Messages
384
Store the floating text and the unit into a variable. And refresh the position of the floating text each 0.04 seconds. (or something like that)

Can u give trigger [tiger] example ? plz :*
 
Create a unit and a floating text variable in variable editor.

Trigger 1:

Event:
Player 1 types "test" // or what ever

Actions:
Set unitVariable = YourUnit
FloatingText - Create A Floating Text Above unitVariable
Set floatingVariable = LastCreatedFloatingText
___________________________

Trigger 2

Event:
Every 0.03 seconds of the game

Actions:
FloatingText - Change Position of floatingVariable to Position of unitVariable
___________________________

Read this tutorial if you don't know about memory leaks yet: http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/

(periodic triggers that fire so often always have to be leakless)
 
  • Like
Reactions: hdm
Status
Not open for further replies.
Top