🏆 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!
function MoveUnitAroundCaster(unit circler, unit circlee)
int i = 0
while i >= 0
circler.SetX(circlee.getX() + 250*Cos(i*1/50*PI))
circler.SetY(circlee.getY() + 250*Sin(i*1/50*PI))
if i += 1 < 2147483647
i++
wait(1/50)
The principle is that we have a certain interval such as 0.04 or 0.03, (I used 0.02 or 1/50.), and that we move the circler around the circlee via SetUnitX and SetUnitY, basing the coordinates off of the circlee's coordinates. We allow the passage of that time interval to execute the moving all over again.
Do note that for all intents and purposes, a timer should be used for periodic intervals of such shortness instead of a Wait - real someDur seconds GUI function because of desynchronization.
RotationSpeed is an angle (real), currently it is meant to hold an anglechange in seconds.
Means if you put there 60 your Missle rotate 60° anticlockwise a second.
for clockwise rotation you need to use negative rotationspeed
Ok, I've tries it but there is a problem. It rotates in a circle form, but there is like an error that it overlaps on the center and moves instantly to the opposite of the point it must be and I don't know why. It shows like 2 units rotating around the point.
It is kinds hard to explain because I suck at english, forgive me.
🔨 Downloads and Uploads have been fixed! If you still have trouble downloading or uploading assets to or from Hive, please reach out to us in the Site Discussion board.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.