Hi again all,
I've followed the tutorials and I have managed to get my player to pick up an object and rotate it freely and it works a treat (once again Chris the fact that I am able to get this to work is a true testament to how awesome AC really is)!
the problem I am now having though is that to do the above I simply used the cursor and would pick the item up using my cursor however I have a 3rd person game and as such I need my player to move up to an object, you click the action button for the player to pick up the object (I'm using FinalIK plugin to handle that aspect of things) however I am hoping that there is then a simple way that I can rotate the object in a controlled manner whilst the player has the object in their hand?
Essentially I'm trying to achieve something similar to LA Noire when the player inspects certain items that they pick up (see 51 seconds into this video where the player inspects a bloody wrench
https://www.youtube.com/watch?v=CDXXQORXXTQ). The limits of the rotation would have to obviously stay within the characters hand limits (so actually would I be rotating the object or simply rotate the hand instead)?
Many thanks in advance for your help, as with everything I have tried myself to come up with a solution but after nearly a week I'm giving up and asking lol.
Comments
If you want to try doing it with AC in combination with FinalIK and some custom scripting, I'd instead recommend looking into the Draggable type - it's Rotate Only mode means that you can't move it, meaning the player can't accidentally throw it off-screen or something, and you have full control over it's position which you could feasibly manipulate via the OnGrabMoveable / OnDropMoveable custom events.
However, I feel it would be better to write a custom implementation from scratch - as there is much more to consider beside rotation constraints. Animating the pickup to a default rest pose, putting it back in the same spot, etc, are all extra considerations. You can disable AC while your own system is running easily enough using the Engine: Manage systems Action.
To be honest I don't think I've ever checked out the Wiki (I know, what an idiot I am lol). I'll check this out, I have managed to call the required FinalIK interactions though using my own custom scripts however I am certain that a custom Action from some real programmers in this community will be of much more use to me so I'll still check these out.
As for the solution I went with I used the AimIK component, I attached that to the players hand (I think I included the forearm in the bone hiearachy along with the hand so that it looked more believable). I would start with the AimIK component disabled however when the player picks up the object (using FinalIK) I would then enable the AimIK component. The target that the AimIK looks at is, at the moment, a small sphere attached to the object as a child of that object. The target is then moveable via a custom script that is dictated by the CursorHorizontal and CursorVertical axes (so that this can be moved via the mouse or even a controller since I've mapped both Mouse Movement and Right Analog Stick to those respective axes).
Within the custom script that controls the movement of the target there are limits within that so that the target only moves within a confined area to ensure that the players hand can't contort into unnatural positions. This element is still not perfect (the players hand is still turning just slightly too far however I'm not spending time tweaking this at the moment since it is working fine for now and I'm just happy that I managed to get the limitations working and the players hand doesn't turn 360 degress unimpeded lol).
Here is a quick video, obviously missing a hell of a lot of polish and it is a simple test scene however I am so pleased that I've even got it working after only 2 nights of working on it so to me the video looks amazing and is a worthy GOTY winner haha!
You can see the target of the AimIK visible in the video, it is the small sphere with the default material on it - obviously this will be invisible going forward however in this initial testing phase (and for showing to yourself) having it visible is obviously beneficial. I also need to tweak the hand poser as the sphere object doesn't quite sit right in the hand when picked up (however the sphere is a placeholder and not an object that the player will actually be able to pick up so no point in me tweaking this - I'll just to make sure I'm more thorough when I integrate this onto an object that the player will actually be able to pick up)!
Nice! I like your use of Aim IK, that's a clever angle. I don't think I can go that route though, as I'm using Opsive's Third Person Controller and Aim IK is used for, well, aiming (I have combat in my game). I have the character examine objects once he's picked them up by using Adventure Creator's Transform / Rotate Action (this is automated though, not player controlled).