View Single Post
Old 05-09-2009, 08:35 AM   #12
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

What's with all of the unnecessary and ugly code in that test map?

It's not SetUnitLookAt that won't update, it's your SetDummyFacing function that's incorrect. It is deliberately designed to only pick one of 8 angles rather than rotating in a complete circle. Try using my function instead of yours and you will see that the facing angle updates instantly, but flickers to an incorrect direction each time it's set.

If you want a unit to achieve perfectly smooth rotation you need to make it follow another unit, I included a test map to demonstrate.

If you want to manipulate a unit's pitch, there are four ways that work:
1.) Make your projectile face any 3 dimensional orientation you want when it spawns, and leave it that way until the projectile gets recycled.
2.) Make your projectile face a homing target, it will naturally pitch to face it and it will animate smoothly.
3.) If you want to set pitch to an arbitrary value, you need to make the dummy unit follow another invisible unit. But you can't pitch straight down unless the projectile is in the air, otherwise the invisible unit can't fit underneath it.
4.) Or just use the pitch animations of the dummy unit, but you can't combine these with any sort of instant facing. If you want instant facing too you would need to create a new unit.
Attached Files
File Type: w3x DummyTest.w3x (24.4 KB, 209 views)
grim001 is offline   Reply With Quote