add sideways movement to character demo?

Software: Away3D 4.x

hfeist, Jr. Member
Posted: 08 May 2013 03:20 PM   Total Posts: 37

I’m trying to make the character in the character demo also walk sideways. At the moment he can move forward and back or rotate left or right via arrow keys but not laterally.
Might there be a clue here?

if (keyForward)
    
{
     
if (walkDirection.length == 0)
     
{
      _animationController
.play("walk"_stateTransition);
      
_animationController.playbackSpeed 1;
     
}
     walkDirection 
character.ghostObject.front;
     
walkDirection.scaleBy(walkSpeed);
     
character.setWalkDirection(walkDirection);
    

   

Avatar
oldkyx, Newbie
Posted: 22 May 2013 06:48 AM   Total Posts: 4   [ # 1 ]
if (keyLeft{
walkDirection 
level.playerBody.ghostObject.right;
walkDirection.scaleBy(walkSpeed);
level.playerBody.setWalkDirection(walkDirection);
}
if (keyRight{
walkDirection 
level.playerBody.ghostObject.right;
walkDirection.scaleBy(-walkSpeed);
level.playerBody.setWalkDirection(walkDirection);
   

hfeist, Jr. Member
Posted: 22 May 2013 04:18 PM   Total Posts: 37   [ # 2 ]

thanks oldkyx.
i had been looking for something like “ghost object.left” which of course is just a MINUS “ghost object.right”!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X