HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: [Resolved] character rotations  (Read 2051 times)


  • General Accounts
  • *
  • Posts: 153
    • View Profile
[Resolved] character rotations
« on: Aug 13, 11, 03:46:11 PM »

I'm working on my character creation camera and character interaction.  I have it setup so that clicking and dragging will rotate the character.  This works as intended, however when I release the mouse, the character wants to return to it's previous heading (180 degrees).  I've played around with trying to stop this behavior but not having any luck.  I intend to continue to try and figure out how to handle this ( I want the character to stay rotated when the drag is complete).  In the meantime, if anyone has any advice, it may save me some digging around time.
« Last Edit: Nov 01, 12, 10:37:19 AM by HE-Cooper »
Ron Farrell
Lead Programmer
Triad Game Studios


  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: character rotations
« Reply #1 on: Aug 14, 11, 04:46:18 PM »

Yep, Ron, we had to deal with that, too. Finally found it in the E_ACCController class (and its parent, HeroEngine_ACCController).  There is a command to the behave system called heading.  If you search those class scripts for "heading" (with quotation marks), you'll see below it the different values that can be used after it and their parameters.

The default is "camera", which makes the character turn relative to the camera angle.  You just need to set the character's behave to "none":

Code: [Select]
$Behave._DoBehave(charNode, "heading none")(You can use GetPlayerCharacterNode() to get the local client's character)

From Server-side:
Code: [Select]
$Behave._SendBehave(charID, "heading none")
Setting it back to "heading camera" will return to turning with the camera.  There are some other interesting options, as well, such as having the character always face:
  • a given heading (in degrees)
  • a node of a 3D object
  • or a point in space
« Last Edit: Aug 14, 11, 04:48:02 PM by ScottZarnke »
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.