Does anyone know how I could get an attack animation to track with my camera?
My current setup is a saved project with all the ORK tutorials having been finished using the sample assets.

Basically, I need the attacks to be like an Elder Scrolls game where it attacks what you're looking at.
The sample assets have attacks like a Dark Souls title. Fixed attack animations with no vertical tracking.

I appreciate any advice.
  • look at the how to's on the real time stuff if your doing a attack that has to hit a target just set the ability's target range to none
    new website can be found here

    Follow the game Development on Twitter

    or check out the face book page here
  • @wtyson

    What I mean is that I need to find a way to attack up/down.
    I got the real time damage dealers to work just fine.
    But now I need a way to have the weapon attached to the camera and follow it while still animating properly.

    I tried making a phantom version of Brown Pants attached to the main camera.
    The weapon I kept visible while the skeleton and mesh were turned to a different layer.
    I think I got close, but I just feel like there must be an easier, more effective way.
  • In addition, I need the Interaction Controller to move with the camera.
    So a player can interact with the ceiling or floor.
  • Probably best to make the player prefab have the camera mounted and put your stuff there.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on!
  • I made an event that mounts the main camera to the player upon scene change.
    By attaching the interaction controller to the camera prefab, that's one issue solved.

    But no matter what I try, I can't get the arms to face the direction I'm looking.
  • Okay, I finally found a solution of sorts.
    If anyone else is struggling with 1st person attacks, let me know and I'll show you how I did it.
  • I'd be interested to know how you did it. : )
  • edited August 2015
    This solution presumes you've completed the ORK tutorial and are using ORK tutorial assets.

    1) Set first person camera with an offset of Y = 1.5

    2) Make a camera prefab tagged as Main Camera. Call it CustomCam.

    3) Add an interaction controller as a child object to the Main Camera
    Reduce the X and Y scaling on the interaction controller so that it aims more precisely.
    Keep the Z scaling long enough that you can pick up things on the ground.

    4) Add 2 new cameras as children to the Main Camera

    Call the first camera BodyViewer and the 2nd WeaponViewer
    Reduce the culling mask of BodyViewer to see only HiddenBody layer
    Reduce the culling mask of WeaponViewer to see only HiddenWeapon layer

    Pull the BodyViewer cam back away from the player so it can see the entire player prefab.
    Set it to render under the Main Camera layer.
    This will enable animations on the model even when it isn't drawn by the Main Camera.

    Zero out the position and rotation of WeaponViewer cam so it aligns with Main Camera perfectly.
    Then set it to render over the Main Camera layer.
    This will keep your weapons from visually clipping.

    5) Add a hardpoint (an empty game object) to Main Camera.
    Inverse the offset of the first step.
    (In this case, make the hardpoint Y = -1.5 in the local space of its parent)

    6) Set player prefab to new layer HiddenBody

    7) Set all weapon prefabs to new layer HiddenWeapon

    8) Make a Global Event which parents objects on scene change.
    You'll need to mount the camera with it's children on the player.
    Then mount and position the player's skeleton on the camera's hardpoint.

    Just make sure each scene has your special prefab camera for its Main Camera

    [I typed this out in a hurry. Let me know if you have any trouble or if I made a mistake in the instructions.]
    Post edited by Klep on
Sign In or Register to comment.