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.
Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games
or check out the face book page here https://www.facebook.com/ForeLoreGames
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.
So a player can interact with the ceiling or floor.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
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.
If anyone else is struggling with 1st person attacks, let me know and I'll show you how I did it.
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.]