• 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.

Lock body part facing.

Status
Not open for further replies.
Level 6
Joined
Mar 15, 2005
Messages
112
Basically what I want to do is make my hero's head face left or right when I press left/right arrow keys. I've tried facing angles polar offsets etc. My camera in the game looks left/right when you use arrow keys and I thought it would be cool if your hero looked in that direction. I've tried using an invisible dummy unit that is always moved in front of your hero, but with no success. I can get this to work perfectly if my hero is facing north. Please test your suggestion before replying and thanks.

Turn Head
Events
Player - Player 1 (Red) Presses the Left Arrow key
Conditions
Actions
-------- This is just an example --------
Animation - Lock Hero[1]'s Head to face Hero[1]?, offset by (0.00?, 0.00?, 0.00?)
 
Level 6
Joined
Sep 13, 2008
Messages
261
Just make the dummy unit move to polar offset of cameras rotation and lock the units head to the dummy. I attached file for reference. Zoom and rotate camera it works.

I explain things bad just check the example in the attachment.
 
Last edited:
Level 6
Joined
Mar 15, 2005
Messages
112
OF COURSE! lol. I was trying create dummy at polar offset of hero right in front of him and using the body part facing's offsets to change which direction (those offsset always use north as a reference). Just wondering if this will work with a first person camera since its using current camera as the reference. I think it should. Thanks

Edit: I have this working now Moderators feel free to mark this as solved.
+rep for howl =D
 
Last edited:
Level 19
Joined
Aug 24, 2007
Messages
2,888
Why not making unit face to itself with polar offset instead of making dummy
(for polar offset: Cos(direction) for X and Sin(direction) for y)
 
Status
Not open for further replies.
Top