• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Create Unit, Move Unit and Make Unit Fly

Status
Not open for further replies.
Level 7
Joined
Nov 18, 2012
Messages
272
I want to create a unit at a point and make it fly.

  • Unit - Turn collision for (Last created unit) Off
  • Unit - Move (Last created unit) instantly to M_Point[M_Int]
  • Unit - Add Crow Form to (Last created unit)
  • Animation - Change (Last created unit) flying height to (R_FlyingHeight[2] + (Default flying height of (Last created unit))) at 10000.00
  • Unit - Remove Crow Form from (Last created unit)
It gets created and all, it ignores collision and gets moved no matter what, but it won't fly... Why?
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
ow lol yea thats right, I even wrote it but then I thought eh...thats surly wrong, and deleted it

maybe try printing the last created unit's name, if it even exists
also try printing the R_FlyingHeight[2] + (Default flying height of (Last created unit)) to make sure its something > 0

if neither of that is wrong, I am clueless
 
Level 7
Joined
Nov 18, 2012
Messages
272
ow lol yea thats right, I even wrote it but then I thought eh...thats surly wrong, and deleted it

maybe try printing the last created unit's name, if it even exists
also try printing the R_FlyingHeight[2] + (Default flying height of (Last created unit)) to make sure its something > 0

if neither of that is wrong, I am clueless

R_FlyingHeight[2] is predefined in startup and works well in multiple triggers.
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
I'm not sure, but the arithmetic might be causing a problem, try setting that to a real variable and then plugging it in.

I can't imagine, but maybe add and remove crow form before changing the height.

EDIT: I'm not sure why your trigger isn't working, I just did the exact same thing and it seems to work properly
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
It's formula is Speed = Distance / Time
Speed = Rate
Distance = Height

This is what you got;
10000.00 = R_FlyingHeight[2] / Time
Time = R_FlyingHeight[2] / 10000.00

For example, your R_FlyingHeight[2] is 300,
Time = 300 / 10000.00
Time = 0.03s

Everything worked fine when I tested this formula, perhaps something wrong with your setup or Object Editor error ?
 
Status
Not open for further replies.
Top