Results 1 to 9 of 9
  1. #1
    MSgt. Shooter Person
    Join Date
    Aug 2010
    Posts
    71

    Default full 360^ char movement?

    im not sure what to call it but what im trying to do is have one running animation play for the front,back,left,and right directions but the character faces the direction i want it to go. for example,if i press left the character plays the same running animation thats set for the forward animation only he's rotated to face left.like alot of games like assassins creed and such. does anybody have an idea how to do this?it seems like im missing something simple.

    another thing thats somewhat unrelated,i made a run animation and in udk i cant get past two major problems.one, it has that "sliding" effect or like the character is not in synch with the speed or whatever. i think oblivion had this problem.

    and also, the run anim is a looping one but its obvious when it clicks to the beginning.its not smooth even though the first and last frame are the same.i used biped copy/paste poses technique.

    if anybody can help with any of this i'd be very grateful!

  2. #2
    MSgt. Shooter Person
    Join Date
    Nov 2007
    Posts
    216

    Default

    Within the AnimTree, you do have the option to separate body parts, like upper body and lower body, which then can be blended. I don't know how it's done in detail though.


    Your second problem is "skiing" (not uncommon, even in a lot of AAA releases due to basic problems with interaction and pre-baked animation) you either have to adjust the speed of the character (has to be done in scripts) or the animation speed to fit the movement speed. Also secondary animation helps a lot to cover that problem.

    Your third problem though must be your animation. Check your biped and its animation very carefull for errors. I just had the same, where I had to point out the error 10 times to the animator before he actually noticed the glitch he'd accidentally put into the rig/animation (that was CAT though).

  3. #3
    MSgt. Shooter Person
    Join Date
    Jun 2011
    Posts
    171

    Default

    http://forums.epicgames.com/threads/...era-code/page4

    online|offline's version of this set up - it may be like what you are looking for, though I could never get the zoom to work. You could probably set up animtree to have a forward, then copy an idle for strafes and backwards, as they will only be seen for a couple frames.

  4. #4
    MSgt. Shooter Person
    Join Date
    Aug 2010
    Posts
    71

    Default

    Haldolium,

    i remember something about seperating body parts but im not trying to seperate them, im trying to take the pawn and animation when he is running forward to be the same animation for running to the left or right side or backwards, but just rotated to face that direction.see? its one animation,no strifing for the sides just rotating the pawn to be running in that direction.

    and about skiing,what do you mean secondary animation?

  5. #5
    MSgt. Shooter Person
    Join Date
    Nov 2007
    Posts
    216

    Default

    Quote Originally Posted by RocknRollCowboy View Post
    Haldolium,

    i remember something about seperating body parts but im not trying to seperate them, im trying to take the pawn and animation when he is running forward to be the same animation for running to the left or right side or backwards, but just rotated to face that direction.see? its one animation,no strifing for the sides just rotating the pawn to be running in that direction.
    Hmm ok I might see what you mean. You want the character to turn 90° (sidewards) to 180° (backwards) but the camera should stay as it is? If that's the case I think the scripting thread that PsychotropicDog linked is a better place to start.

    and about skiing,what do you mean secondary animation?
    http://en.wikipedia.org/wiki/Secondary_animation

    That is mostly ignored by beginners but very important in general.

  6. #6
    MSgt. Shooter Person
    Join Date
    Aug 2010
    Posts
    71

    Default

    oh ok,secondary animation.i didnt know that was a seperate thing,i thought you were supposed to do all that already.

    alrighty well ill look at it again,thanks for yalls inputs!

    edit: actually,do you know how the movement and camera is on games like gta 4,hitman blood money, or mafia 2? im trying to do the same thing.
    Last edited by RocknRollCowboy; 04-15-2012 at 04:58 PM.

  7. #7
    MSgt. Shooter Person
    Join Date
    Dec 2011
    Posts
    104

    Default

    yes, scripting is the answer. You need to make sure that the player controller does not move in sync with the player's direction, and that it can be rotated with the mouse, which seems simple enough from a programming perspective... good luck!

  8. #8
    MSgt. Shooter Person
    Join Date
    Jan 2012
    Posts
    31

    Default

    There was a thread on camera movements,and in there i found something that might get your attention
    For less talking and more practical guide have a look at a code i'm currently using in a game
    class MyPawn extends GamePawn;

    var float CamOffsetDistance; //distance to offset the camera from the player in unreal units
    var float CamMinDistance, CamMaxDistance;
    var float CamZoomTick; //how far to zoom in/out per command
    var float CamHeight; //how high cam is relative to pawn pelvis

    simulated function SetMeshVisibility(bool bVisible)
    {

    // Handle the main player mesh
    if (Mesh != None)
    {
    Mesh.SetOwnerNoSee(!bVisible);
    }


    }

    //override to make player mesh visible by default
    simulated event BecomeViewTarget( PlayerController PC )
    {
    local UTPlayerController UTPC;

    Super.BecomeViewTarget(PC);

    if (LocalPlayer(PC.Player) != None)
    {
    UTPC = UTPlayerController(PC);
    if (UTPC != None)
    {
    //set player controller to behind view and make mesh visible
    UTPC.SetBehindView(true);
    SetMeshVisibility(UTPC.bBehindView);

    //Show Crosshair = false, hide = true
    UTPC.bNoCrosshair = true;
    }
    }
    }

    simulated function FaceRotation(rotator NewRotation, float DeltaTime)
    {
    // Do not update Pawn's rotation if no accel
    if (Normal(Acceleration)!=vect(0,0,0))
    {
    if ( Physics == PHYS_Ladder )
    {
    NewRotation = OnLadder.Walldir;
    }
    else if ( (Physics == PHYS_Walking) || (Physics == PHYS_Falling) )
    {
    NewRotation = rotator((Location + Normal(Acceleration))-Location);
    NewRotation.Pitch = 0;
    }
    NewRotation = RLerp(Rotation,NewRotation,0.1,true);
    SetRotation(NewRotation);
    }

    }

    //orbit cam, follows player controller rotation
    simulated function bool CalcCamera( float fDeltaTime, out vector out_CamLoc, out rotator out_CamRot, out float out_FOV )
    {
    local vector HitLoc,HitNorm, End, Start, vecCamHeight;

    vecCamHeight = vect(-20,20,0);
    vecCamHeight.Z = CamHeight;
    Start = Location;
    End = (Location+vecCamHeight)-(Vector(Controller.Rotation) * CamOffsetDistance); //cam follow behind player controller
    out_CamLoc = End;

    //trace to check if cam running into wall/floor
    if(Trace(HitLoc,HitNorm,End,Start,false,vect(12,12 ,12))!=none)
    {
    out_CamLoc = HitLoc + vecCamHeight;
    }

    return true;
    }

    simulated function CamZoomIn()
    {
    if(CamOffsetDistance > CamMinDistance) CamOffsetDistance-=CamZoomTick;
    }

    simulated function CamZoomOut()
    {
    if(CamOffsetDistance < CamMaxDistance) CamOffsetDistance+=CamZoomTick;
    }

    defaultproperties
    {
    CamHeight = 40.0
    CamMinDistance = 160.0
    CamMaxDistance = 350.0
    CamOffsetDistance=250.0
    CamZoomTick=20.0
    Begin Object Class=SkeletalMeshComponent Name=SkelComp
    CastShadow=true;
    bCastDynamicShadow=true;
    bOwnerNoSee=false;
    BlockRigidBody=true;
    CollideActors=true;
    BlockZeroExtent=true;
    PhysicsAsset=PhysicsAsset'xxxxx'
    AnimSets(0)=AnimSet'xxxx'
    MorphSets(0)=MorphTargetSet'xxxx'
    AnimTreeTemplate=AnimTree'xxxxx'
    SkeletalMesh=SkeletalMesh'xxxx'
    bHasPhysicsAssetInstance=True
    End Object
    Mesh=SkelComp
    Components.Add(SkelComp)
    Begin Object Class=SkeletalMeshComponent Name=SkelComps
    CastShadow=true;
    bCastDynamicShadow=true;
    bOwnerNoSee=false;
    BlockRigidBody=true;
    CollideActors=true;
    BlockZeroExtent=true;

    bHasPhysicsAssetInstance=True
    End Object
    }
    P.S.: Don't forget to deplace what's needed(especially the xxxx's)...Cheers

  9. #9
    MSgt. Shooter Person
    Join Date
    Dec 2010
    Posts
    125

    Default

    So the left / right animations are meant for strafing. When your character is pointed in the direction they're moving, it'll use the forward animation. You need to tell the controller that left/right/backwards doesn't strafe - instead, it should rotate the character in a given direction and use the forward run animation. The tricky part is setting a good rotation animation to help string the two actions together. There's some discussion on the topic, here: http://forums.epicgames.com/threads/...-In-Place-Node

    As for the pop you see in your animation, I believe, based on your description, that it's occurring because you're using the same first/last frame. This essentially makes one of your animation frames play twice. You can either move the last frame one frame out of range of your animation or add a keyframe for all bones on the second to last frame and then overwrite your last frame using these new keyframes.


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.