Announcement

Collapse
No announcement yet.

Help with PlayCameraAnim

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help with PlayCameraAnim

    Hello guys!

    I am having now a problem with the UTPlayerController function PlayCameraAnim

    I did remake the knifekills system for my game, just like Mortal Kombat with X-Ray Effect, but I am not being able to fix the camera animation.

    This knifekills system is basically two animations which play in synchronization on both Player Pawn and Enemy Pawn:

    Code:
     //this statement will play the knife kill animation back on the player
        UTPawn(EventInstigator.Pawn).FullBodyAnimSlot.SetActorAnimEndNotification(true);
        UTPawn(EventInstigator.Pawn).FullBodyAnimSlot.PlayCustomAnim('knife_kill_1_b_player_UT3', 1.0, 0.25, 0.25, false, true);
    
    //this statement will play the knife kill animation back on the enemy pawn
        FullBodyAnimSlot.SetActorAnimEndNotification(true);
        FullBodyAnimSlot.PlayCustomAnim('knife_kill_1_b_enemy_UT3', 1.0, 0.25, 0.25, true, true);
    Who triggers these animations is the TakeDamage Event of the Enemy Pawn, whenever it detects being hitted by the knife weapon:

    Code:
    if (DamageType == class'UTDmgType_AIKnife')
    Everything is working perfectly, except for the camera.

    I have first created a cutscene in Unreal Matinee, to be used as reference whenever recreating it on Unreal Script:

    https://drive.google.com/open?id=1-h...RAUw6TRsYwvcwx

    All these sounds like knife impact, soldier's scream, blood splat (particle emitter), they are triggered directly on the Soldier's Animation through AnimNotifies. In example, on the cutscene, the knife impact sound plays at time 1.05s, so I created a new AnimNotify on this time 1.05s to play the sound, and so on...

    The camera animation I created in Matinee then exported it from Matinee "Save Camera Animation", then on the enemy pawn script, I used this function to play the camera animation:

    Code:
    //this will reset the camera to default position and rotation
    UTPlayerController(localplayer).SetRotation(UTPawn(EventInstigator.Pawn).Rotation);
    
    //this is the function to play the camera animation
    UTPlayerController(localplayer).ClientPlayCameraAnim(CameraAnim'combat_knife.Cameras.KnifeKill1Camera',,,,,,,CAPS_CameraLocal,);
    I tried almost all functions to play camera animations, like:

    Code:
    UTPlayerController(localplayer).PlayerCamera.PlayCameraAnim(CameraAnim'combat_knife.Cameras.KnifeKill1Camera',,,,,,,,)
    
    UTPlayerController(localplayer).PlayCameraAnim(CameraAnim'combat_knife.Cameras.KnifeKill1Camera',,,,,,)
    However, for all these function, this is the result (bug):
    https://drive.google.com/open?id=1XV...2h5ZTL3o4O3jvq

    I did assure that the first keyframe of the matinee camera is exactly the same default in-game camera position:

    Matinee Camera
    Click image for larger version

Name:	camera_matinee.png
Views:	61
Size:	539.4 KB
ID:	1735041

    Game Camera
    Click image for larger version

Name:	camera_game.png
Views:	40
Size:	580.3 KB
ID:	1735042

    Any help?
    https://sites.google.com/view/udkultimate/


    #2
    To flank around your problem maybe you could try camera shake? idk
    Some cool unreal projects you may like!


    Developer of GOTA - Survivalism Gladiatorial game Buy the game google gladiators of the arena steam https://store.steampowered.com/app/7..._Of_The_Arena/

    Download the demo Download the demo
    external link Dropbox DropBox

    Become a c++ Professional now C++ Networking Tutorial

    Comment


      #3
      Hello Neongho!

      Yeah, I added

      UTPlayerController(localplayer).ViewShake(1.00);

      before

      UTPlayerController(localplayer).PlayCameraAnim(CameraAnim'combat_knife.Cameras.KnifeKill1Camera',1,,,,,);

      It just did reset the player camera, but the bug happenned again.

      However, after almost crushing my head on my desk I finally found the problem, and the solution (lol).

      It seems that a matinee animated camera had some offsets whenever importing this animation on the player camera.

      So I had to manually fix each keyframe position of my animated camera (mainly move down on z axis, moving a bit on x axis, and so on). Also, just a little sacrifice I had to do, otherwise I wouldn't being able to fix the camera, is that I removed the interpolation between frames constant, I made the camera animation with constant interpolation between each keyframe, so this way I could simulate many cameras in-scene, with just one camera!

      Now it is working in-game, with all its glory and gore :

      https://drive.google.com/file/d/1uAx...EZl_tipp_/view

      Thanks!
      https://sites.google.com/view/udkultimate/

      Comment


        #4
        Awesome man very glad you got it .
        Some cool unreal projects you may like!


        Developer of GOTA - Survivalism Gladiatorial game Buy the game google gladiators of the arena steam https://store.steampowered.com/app/7..._Of_The_Arena/

        Download the demo Download the demo
        external link Dropbox DropBox

        Become a c++ Professional now C++ Networking Tutorial

        Comment

        Working...
        X